view rust/hg-core/src/operations/mod.rs @ 45000:5965efb609b6

hg-core: add FindRoot operation to find repository root path Differential Revision: https://phab.mercurial-scm.org/D8609
author Antoine Cezar <antoine.cezar@octobus.net>
date Fri, 05 Jun 2020 08:48:09 +0200
parents a46e36b82461
children 98817e5daca7
line wrap: on
line source

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>;
}