pub struct TempRepository { /* private fields */ }Expand description
A Repository that is created for temporary operations, such as cloning.
When the TempRepository is no longer needed, then call one of destructors:
TempRepository::cleanup: remove the repository directoryTempRepository::mv: move the repository directory to a final destination and remove the old directory
TempRepository implements AsRef so that the Repository can be
used in places where a Repository is needed.
Implementations§
Source§impl TempRepository
impl TempRepository
Sourcepub fn cleanup(self)
pub fn cleanup(self)
Clean up the temporary directory of the repository.
Note that the repository is dropped first to ensure that there are no handles to the repository, before removing the directory.
Sourcepub fn mv<P>(self, to: P) -> Result<(), Error>
pub fn mv<P>(self, to: P) -> Result<(), Error>
Move the temporary directory of the repository to the new path.
If to already exists, then the temporary directory is removed, and the
repository is not moved.
Note that the repository is dropped first to ensure that there are no handles to the repository, before removing the directory.
Trait Implementations§
Source§impl AsRef<Repository> for TempRepository
impl AsRef<Repository> for TempRepository
Source§fn as_ref(&self) -> &Repository
fn as_ref(&self) -> &Repository
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for TempRepository
impl RefUnwindSafe for TempRepository
impl Send for TempRepository
impl !Sync for TempRepository
impl Unpin for TempRepository
impl UnwindSafe for TempRepository
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> 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