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§
Sourcefn old_operation_id(&self) -> &OperationId
fn old_operation_id(&self) -> &OperationId
The operation at the time the lock was taken
Sourcefn old_tree_id(&self) -> &MergedTreeId
fn old_tree_id(&self) -> &MergedTreeId
The tree at the time the lock was taken
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn rename_workspace(&mut self, new_workspace_name: WorkspaceNameBuf)
fn rename_workspace(&mut self, new_workspace_name: WorkspaceNameBuf)
Update the workspace name.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>
fn sparse_patterns(&self) -> Result<&[RepoPathBuf], WorkingCopyStateError>
See WorkingCopy::sparse_patterns()
Sourcefn 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 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.
Sourcefn 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,
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
impl dyn LockedWorkingCopy
Sourcepub fn downcast_ref<T: LockedWorkingCopy>(&self) -> Option<&T>
pub fn downcast_ref<T: LockedWorkingCopy>(&self) -> Option<&T>
Returns reference of the implementation type.
Sourcepub fn downcast_mut<T: LockedWorkingCopy>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: LockedWorkingCopy>(&mut self) -> Option<&mut T>
Returns mutable reference of the implementation type.