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§
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(&self) -> Result<&MergedTree, WorkingCopyStateError>
fn tree(&self) -> Result<&MergedTree, WorkingCopyStateError>
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<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn LockedWorkingCopy>, WorkingCopyStateError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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
impl dyn WorkingCopy
Sourcepub fn downcast_ref<T: WorkingCopy>(&self) -> Option<&T>
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".