pub struct Stage { /* private fields */ }Expand description
Where a run keeps what it is about to replace.
Implementations§
Source§impl Stage
impl Stage
Sourcepub fn backup_path(&self, digest: &Sha256) -> Utf8PathBuf
pub fn backup_path(&self, digest: &Sha256) -> Utf8PathBuf
Where one backed-up digest is kept.
Sourcepub fn back_up(
&self,
destination: &Utf8Path,
) -> Result<Option<Sha256>, AppError>
pub fn back_up( &self, destination: &Utf8Path, ) -> Result<Option<Sha256>, AppError>
Copy an existing destination into the store, returning its digest.
None means the destination does not exist, which is what tells a
recovery to remove it rather than restore it.
§Errors
Any I/O error reading the destination or writing the copy.
Sourcepub fn restore(
&self,
digest: &Sha256,
destination: &Utf8Path,
) -> Result<(), AppError>
pub fn restore( &self, digest: &Sha256, destination: &Utf8Path, ) -> Result<(), AppError>
Put a backed-up copy back at destination.
§Errors
AppError::Unrecovered when the copy is gone, and any I/O error
of the write.
Sourcepub fn write(
destination: &Utf8Path,
bytes: &[u8],
) -> Result<Utf8PathBuf, AppError>
pub fn write( destination: &Utf8Path, bytes: &[u8], ) -> Result<Utf8PathBuf, AppError>
Write bytes to a scratch file beside destination.
The scratch file is created exclusively, so a path already there — a symlink included — refuses rather than being followed.
§Errors
Any I/O error creating the parent, the scratch file, or syncing it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stage
impl RefUnwindSafe for Stage
impl Send for Stage
impl Sync for Stage
impl Unpin for Stage
impl UnsafeUnpin for Stage
impl UnwindSafe for Stage
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