pub struct MmapFilePusher { /* private fields */ }Expand description
File pusher using memory-mapped I/O for zero-copy writes.
Delegates writes to the OS via MmapMut. The file size is fixed at
construction time via file.set_len(size). On flush,
if sync_all is true an fsync is performed; otherwise an async flush
is issued.
Implementations§
Trait Implementations§
Source§impl Debug for MmapFilePusher
impl Debug for MmapFilePusher
Source§impl Pusher for MmapFilePusher
impl Pusher for MmapFilePusher
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Data is already in the shared mapping, visible to any other reader.
Only sync_all forces the dirty pages out; otherwise this is a no-op so
the writeback is left to the OS instead of blocking the download on
msync/FlushViewOfFile. The mapping keeps the pages reachable until the
pusher is dropped, so the data is never lost.
Source§fn set_listener(&mut self, cb: ProgressListener)
fn set_listener(&mut self, cb: ProgressListener)
Install a callback that fires whenever a chunk has been successfully
pushed to its destination. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MmapFilePusher
impl !Sync for MmapFilePusher
impl !UnwindSafe for MmapFilePusher
impl Freeze for MmapFilePusher
impl Send for MmapFilePusher
impl Unpin for MmapFilePusher
impl UnsafeUnpin for MmapFilePusher
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