pub struct StagedFile { /* private fields */ }Expand description
Verified bytes held in private staging beside an authorized local output. Dropping an uncommitted file removes its staging directory best effort.
Implementations§
Source§impl StagedFile
impl StagedFile
Sourcepub fn prepare(
path: &Path,
bytes: &[u8],
overwrite: bool,
) -> Result<StagedFile, Error>
pub fn prepare( path: &Path, bytes: &[u8], overwrite: bool, ) -> Result<StagedFile, Error>
Write, flush, sync and verify bytes without changing the destination.
Sourcepub fn commit(self) -> Result<PublishReport, PublishError>
pub fn commit(self) -> Result<PublishReport, PublishError>
Install the verified bytes, then acknowledge parent-directory durability. A durability error names the output that has already committed.
Trait Implementations§
Source§impl Drop for StagedFile
impl Drop for StagedFile
Auto Trait Implementations§
impl Forget for StagedFile
impl Freeze for StagedFile
impl Move for StagedFile
impl RefUnwindSafe for StagedFile
impl Send for StagedFile
impl Sync for StagedFile
impl Unpin for StagedFile
impl UnsafeUnpin for StagedFile
impl UnwindSafe for StagedFile
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