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§
Sourcefn name(&self) -> &str
fn name(&self) -> &str
The name/id of the implementation. Used for choosing the right implementation when loading a working copy.
Sourcefn workspace_name(&self) -> &WorkspaceName
fn workspace_name(&self) -> &WorkspaceName
The working copy’s workspace name (or identifier.)
Sourcefn operation_id(&self) -> &OperationId
fn operation_id(&self) -> &OperationId
The operation this working copy was most recently updated to.
Sourcefn tree_id(&self) -> Result<&MergedTreeId, WorkingCopyStateError>
fn tree_id(&self) -> Result<&MergedTreeId, WorkingCopyStateError>
The ID of the tree this working copy was most recently updated to.
Sourcefn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>
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.
Sourcefn start_mutation(
&self,
) -> Result<Box<dyn LockedWorkingCopy>, WorkingCopyStateError>
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.