Skip to main content

WorkingCopy

Trait WorkingCopy 

Source
pub trait WorkingCopy: Any + Send {
    // Required methods
    fn name(&self) -> &str;
    fn workspace_name(&self) -> &WorkspaceName;
    fn operation_id(&self) -> &OperationId;
    fn tree(&self) -> Result<&MergedTree, WorkingCopyStateError>;
    fn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>;
    fn start_mutation<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn LockedWorkingCopy>, WorkingCopyStateError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The trait all working-copy implementations must implement.

Required Methods§

Source

fn name(&self) -> &str

The name/id of the implementation. Used for choosing the right implementation when loading a working copy.

Source

fn workspace_name(&self) -> &WorkspaceName

The working copy’s workspace name (or identifier.)

Source

fn operation_id(&self) -> &OperationId

The operation this working copy was most recently updated to.

Source

fn tree(&self) -> Result<&MergedTree, WorkingCopyStateError>

The tree this working copy was most recently updated to.

Source

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

Patterns that decide which paths from the current tree should be checked out in the working copy. An empty list means that no paths should be checked out in the working copy. A single RepoPath::root() entry means that all files should be checked out.

Source

fn start_mutation<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn LockedWorkingCopy>, WorkingCopyStateError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Locks the working copy and returns an instance with methods for updating the working copy files and state.

Implementations§

Source§

impl dyn WorkingCopy

Source

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

Returns reference of the implementation type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§