Skip to main content

TreeBuilder

Trait TreeBuilder 

Source
pub trait TreeBuilder {
    type Session: IndexSession;

    // Required methods
    fn begin_from_tree(
        &self,
        tree_ish: &str,
    ) -> Result<Self::Session, EngineError>;
    fn begin_from_current_index(&self) -> Result<Self::Session, EngineError>;
}
Expand description

Opening a scratch index. Never the user’s index, never a checkout (ADR 0011).

Required Associated Types§

Source

type Session: IndexSession

Not object-safe, by design: an associated type makes Box<dyn TreeBuilder> impossible, so runtime dispatch cannot creep back in behind this seam.

Required Methods§

Source

fn begin_from_tree(&self, tree_ish: &str) -> Result<Self::Session, EngineError>

A scratch index seeded from tree_ish.

Source

fn begin_from_current_index(&self) -> Result<Self::Session, EngineError>

A scratch index seeded from the repository’s CURRENT index, for the ADR-0017 uncommitted-state snapshots.

Errors if the index has unmerged entries — a conflicted index has no single tree.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§