pub struct Stage;Expand description
The staging operations, which hold no state of their own.
Implementations§
Source§impl Stage
impl Stage
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 name carries this run, and the file is created exclusively, so the write never lands in one somebody else left. A scratch path already taken refuses rather than being reused: nothing proves an existing file came from a run of this tool, and renaming it over the destination would replace the destination with its contents.
§Errors
Any I/O error creating the parent, the scratch file, or syncing it.
Sourcepub fn write_at(
scratch: &Utf8Path,
destination: &Utf8Path,
bytes: &[u8],
) -> Result<Utf8PathBuf, AppError>
pub fn write_at( scratch: &Utf8Path, destination: &Utf8Path, bytes: &[u8], ) -> Result<Utf8PathBuf, AppError>
Write bytes to one named scratch path beside destination.
The path is the caller’s, which is what lets a test plant something at it and prove the exclusive create refuses rather than follows.
§Errors
As Stage::write.
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