LockedWorkingCopy

Trait LockedWorkingCopy 

Source
pub trait LockedWorkingCopy: Any + Send {
    // Required methods
    fn old_operation_id(&self) -> &OperationId;
    fn old_tree_id(&self) -> &MergedTreeId;
    fn snapshot<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        options: &'life1 SnapshotOptions<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<(MergedTreeId, SnapshotStats), SnapshotError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn check_out<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        commit: &'life1 Commit,
    ) -> Pin<Box<dyn Future<Output = Result<CheckoutStats, CheckoutError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn rename_workspace(&mut self, new_workspace_name: WorkspaceNameBuf);
    fn reset<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        commit: &'life1 Commit,
    ) -> Pin<Box<dyn Future<Output = Result<(), ResetError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn recover<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        commit: &'life1 Commit,
    ) -> Pin<Box<dyn Future<Output = Result<(), ResetError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>;
    fn set_sparse_patterns<'life0, 'async_trait>(
        &'life0 mut self,
        new_sparse_patterns: Vec<RepoPathBuf>,
    ) -> Pin<Box<dyn Future<Output = Result<CheckoutStats, CheckoutError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finish<'async_trait>(
        self: Box<Self>,
        operation_id: OperationId,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn WorkingCopy>, WorkingCopyStateError>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

A working copy that’s being modified.

Required Methods§

Source

fn old_operation_id(&self) -> &OperationId

The operation at the time the lock was taken

Source

fn old_tree_id(&self) -> &MergedTreeId

The tree at the time the lock was taken

Source

fn snapshot<'life0, 'life1, 'async_trait>( &'life0 mut self, options: &'life1 SnapshotOptions<'_>, ) -> Pin<Box<dyn Future<Output = Result<(MergedTreeId, SnapshotStats), SnapshotError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Snapshot the working copy. Returns the tree id and stats.

Source

fn check_out<'life0, 'life1, 'async_trait>( &'life0 mut self, commit: &'life1 Commit, ) -> Pin<Box<dyn Future<Output = Result<CheckoutStats, CheckoutError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check out the specified commit in the working copy.

Source

fn rename_workspace(&mut self, new_workspace_name: WorkspaceNameBuf)

Update the workspace name.

Source

fn reset<'life0, 'life1, 'async_trait>( &'life0 mut self, commit: &'life1 Commit, ) -> Pin<Box<dyn Future<Output = Result<(), ResetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update to another commit without touching the files in the working copy.

Source

fn recover<'life0, 'life1, 'async_trait>( &'life0 mut self, commit: &'life1 Commit, ) -> Pin<Box<dyn Future<Output = Result<(), ResetError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update to another commit without touching the files in the working copy, without assuming that the previous tree exists.

Source

fn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>

See WorkingCopy::sparse_patterns()

Source

fn set_sparse_patterns<'life0, 'async_trait>( &'life0 mut self, new_sparse_patterns: Vec<RepoPathBuf>, ) -> Pin<Box<dyn Future<Output = Result<CheckoutStats, CheckoutError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updates the patterns that decide which paths from the current tree should be checked out in the working copy.

Source

fn finish<'async_trait>( self: Box<Self>, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn WorkingCopy>, WorkingCopyStateError>> + Send + 'async_trait>>
where Self: 'async_trait,

Finish the modifications to the working copy by writing the updated states to disk. Returns the new (unlocked) working copy.

Implementations§

Source§

impl dyn LockedWorkingCopy

Source

pub fn downcast_ref<T: LockedWorkingCopy>(&self) -> Option<&T>

Returns reference of the implementation type.

Source

pub fn downcast_mut<T: LockedWorkingCopy>(&mut self) -> Option<&mut T>

Returns mutable reference of the implementation type.

Implementors§