Skip to main content

TreeMergeExt

Trait TreeMergeExt 

Source
pub trait TreeMergeExt: Sized {
    // Required methods
    fn dir(&self) -> &RepoPath;
    fn value(&self, basename: &RepoPathComponent) -> MergedTreeVal<'_>;
    async fn sub_tree(
        &self,
        name: &RepoPathComponent,
    ) -> BackendResult<Option<Self>>;
    async fn sub_tree_recursive(
        &self,
        path: &RepoPath,
    ) -> BackendResult<Option<Self>>;
}
Expand description

Extension methods for Merge<Tree>.

Required Methods§

Source

fn dir(&self) -> &RepoPath

The directory that is shared by all trees in the merge.

Source

fn value(&self, basename: &RepoPathComponent) -> MergedTreeVal<'_>

The value at the given basename. The value can be Resolved even if self is conflicted, which happens if the value at the path can be trivially merged. Does not recurse, so if basename refers to a Tree, then a TreeValue::Tree will be returned.

Source

async fn sub_tree( &self, name: &RepoPathComponent, ) -> BackendResult<Option<Self>>

Gets the Merge<Tree> in a subdirectory of the current tree. If the path doesn’t correspond to a tree in any of the inputs to the merge, then that entry will be replaced by an empty tree in the result.

Source

async fn sub_tree_recursive( &self, path: &RepoPath, ) -> BackendResult<Option<Self>>

Look up the tree at the given path.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§