view rust/hg-core/src/operations/mod.rs @ 45113:98817e5daca7

hg-core: define a `dirstate_status` `Operation` This is 3/3 in a series of patches to improve dirstate status' code. Following in the footsteps of a46e36b82461, we move the main status functionality to an `Operation`. This will most likely be subject to change in the future (what function signature, what parameters, etc., but we will see when `rhg` gets `hg status` support. Differential Revision: https://phab.mercurial-scm.org/D8663
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 24 Jun 2020 17:53:44 +0200
parents 5965efb609b6
children 452ece5654c5
line wrap: on
line source

mod dirstate_status;
mod find_root;
pub use find_root::{FindRoot, FindRootError, FindRootErrorKind};

/// An interface for high-level hg operations.
///
/// A distinction is made between operation and commands.
/// An operation is what can be done whereas a command is what is exposed by
/// the cli. A single command can use several operations to achieve its goal.
pub trait Operation<T> {
    type Error;
    fn run(&self) -> Result<T, Self::Error>;
}