pub struct CopyWriter { /* private fields */ }Expand description
A copy being written under its temporary name. Dropping it leaves the bytes for the caller’s recorded cleanup.
Implementations§
Source§impl CopyWriter
impl CopyWriter
Sourcepub async fn append(&mut self, bytes: &[u8]) -> Result<(), FileError>
pub async fn append(&mut self, bytes: &[u8]) -> Result<(), FileError>
Append one bounded buffer, completing its disk write before returning.
Sourcepub async fn publish(
self,
path: &Path,
batch: &mut FlushBatch,
) -> Result<(), FileError>
pub async fn publish( self, path: &Path, batch: &mut FlushBatch, ) -> Result<(), FileError>
Sync the bytes, then rename them to path, where nothing may be, in
the same folder, so the copy is whole under its final name or not
there. The copy counts in batch, whose flush syncs the folder and
makes the copy durable before the commit that records it.
Auto Trait Implementations§
impl Freeze for CopyWriter
impl !RefUnwindSafe for CopyWriter
impl Send for CopyWriter
impl Sync for CopyWriter
impl Unpin for CopyWriter
impl UnsafeUnpin for CopyWriter
impl !UnwindSafe for CopyWriter
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