Trait WorkingCopy

Source
pub trait WorkingCopy: Send {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn name(&self) -> &str;
    fn workspace_name(&self) -> &WorkspaceName;
    fn operation_id(&self) -> &OperationId;
    fn tree_id(&self) -> Result<&MergedTreeId, WorkingCopyStateError>;
    fn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>;
    fn start_mutation(
        &self,
    ) -> Result<Box<dyn LockedWorkingCopy>, WorkingCopyStateError>;
}
Expand description

The trait all working-copy implementations must implement.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Should return self. For down-casting purposes.

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_id(&self) -> Result<&MergedTreeId, WorkingCopyStateError>

The ID of 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( &self, ) -> Result<Box<dyn LockedWorkingCopy>, WorkingCopyStateError>

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

Implementors§