pub struct ScratchIndex { /* private fields */ }Expand description
A scratch index and its temp directory, alive together.
Owning the TempDir is what removes the let _keep = idx; hazards the
callers used to need: write_tree borrows the session, so the index file
provably outlives every use of it.
Trait Implementations§
Source§impl IndexSession for ScratchIndex
impl IndexSession for ScratchIndex
Source§fn stage(&mut self, entries: &[IndexEntry]) -> Result<(), EngineError>
fn stage(&mut self, entries: &[IndexEntry]) -> Result<(), EngineError>
Stage a batch in one feed: quoting-proof, and one subprocess instead
of one per file.
Source§fn stage_from_worktree(&mut self, nul_paths: &[u8]) -> Result<(), EngineError>
fn stage_from_worktree(&mut self, nul_paths: &[u8]) -> Result<(), EngineError>
Hash each path’s CURRENT WORKTREE content into the odb and stage it,
admitting new files and dropping ones deleted from the worktree. Read more
Source§fn write_tree(&self) -> Result<String, EngineError>
fn write_tree(&self) -> Result<String, EngineError>
The tree oid of the currently staged state.
Auto Trait Implementations§
impl Freeze for ScratchIndex
impl RefUnwindSafe for ScratchIndex
impl Send for ScratchIndex
impl Sync for ScratchIndex
impl Unpin for ScratchIndex
impl UnsafeUnpin for ScratchIndex
impl UnwindSafe for ScratchIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more