Skip to main content

Worktree

Struct Worktree 

Source
pub struct Worktree { /* private fields */ }
Expand description

Capability-rooted facade for deterministic multi-file edit transactions.

Implementations§

Source§

impl Worktree

Source

pub fn open(root: impl AsRef<Path>) -> Result<Self, WorktreeError>

Opens a worktree with bounded default limits and automatic parallelism.

Source

pub fn open_with( root: impl AsRef<Path>, options: WorktreeOptions, ) -> Result<Self, WorktreeError>

Opens a worktree with explicit limits and preparation parallelism.

Source

pub const fn options(&self) -> WorktreeOptions

Source

pub fn dry_run(&self, plan: &EditPlan) -> Result<DryRunReport, WorktreeError>

Validates, reads, hashes, and projects a plan without creating state.

Source

pub fn prepare( &self, plan: &EditPlan, ) -> Result<PreparedTransaction, WorktreeError>

Locks, validates, backs up, stages, and journals the complete plan.

Source

pub fn apply(&self, plan: &EditPlan) -> Result<ApplyReport, WorktreeError>

Prepares and commits a complete plan.

Source

pub fn dry_run_plan( &self, plan: &WorktreePlan, ) -> Result<WorktreeDryRunReport, WorktreeError>

Validates and projects create/delete/modify/rename operations without writing state.

Source

pub fn prepare_plan( &self, plan: &WorktreePlan, ) -> Result<PreparedWorktreeTransaction, WorktreeError>

Validates, locks, stages, and journals every submitted refactor operation.

Source

pub fn apply_plan( &self, plan: &WorktreePlan, ) -> Result<WorktreeApplyReport, WorktreeError>

Prepares and durably commits every submitted filesystem operation.

Source

pub fn apply_plan_retained( &self, plan: &WorktreePlan, retention: UndoRetention, ) -> Result<RetainedApplyReport, WorktreeError>

Commits a plan while retaining exact rollback evidence and a receipt.

Source

pub fn undo_receipts(&self) -> Result<Vec<UndoReceipt>, WorktreeError>

Lists every retained undo receipt in deterministic identifier order.

Source

pub fn undo_usage(&self) -> Result<UndoStoreUsage, WorktreeError>

Reports the bounded usage of the retained undo store.

Source

pub fn rollback_undo( &self, id: &UndoId, ) -> Result<UndoRollbackReport, WorktreeError>

Exactly restores the state captured by one retained commit.

Source

pub fn discard_undo(&self, id: &UndoId) -> Result<usize, WorktreeError>

Verifies and removes one retained receipt without changing any target.

Source

pub fn recover(&self) -> Result<RecoveryReport, WorktreeError>

Replays and safely resolves an interrupted transaction journal.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.