pub struct LocalWorkingCopy { /* private fields */ }
Implementations§
Source§impl LocalWorkingCopy
impl LocalWorkingCopy
pub fn name() -> &'static str
Sourcepub fn init(
store: Arc<Store>,
working_copy_path: PathBuf,
state_path: PathBuf,
operation_id: OperationId,
workspace_name: WorkspaceNameBuf,
) -> Result<LocalWorkingCopy, WorkingCopyStateError>
pub fn init( store: Arc<Store>, working_copy_path: PathBuf, state_path: PathBuf, operation_id: OperationId, workspace_name: WorkspaceNameBuf, ) -> Result<LocalWorkingCopy, WorkingCopyStateError>
Initializes a new working copy at working_copy_path
. The working
copy’s state will be stored in the state_path
directory. The working
copy will have the empty tree checked out.
pub fn load( store: Arc<Store>, working_copy_path: PathBuf, state_path: PathBuf, ) -> LocalWorkingCopy
pub fn state_path(&self) -> &Path
pub fn file_states(&self) -> Result<FileStates<'_>, WorkingCopyStateError>
Trait Implementations§
Source§impl WorkingCopy for LocalWorkingCopy
impl WorkingCopy for LocalWorkingCopy
Source§fn name(&self) -> &str
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
fn workspace_name(&self) -> &WorkspaceName
The working copy’s workspace name (or identifier.)
Source§fn operation_id(&self) -> &OperationId
fn operation_id(&self) -> &OperationId
The operation this working copy was most recently updated to.
Source§fn 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.
Source§fn 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.Source§fn 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.
Auto Trait Implementations§
impl !Freeze for LocalWorkingCopy
impl !RefUnwindSafe for LocalWorkingCopy
impl Send for LocalWorkingCopy
impl !Sync for LocalWorkingCopy
impl Unpin for LocalWorkingCopy
impl !UnwindSafe for LocalWorkingCopy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more