pub struct DurableFileCacheWriter { /* private fields */ }Expand description
File writer that synchronizes and releases completed page-cache windows.
Implementations§
Source§impl DurableFileCacheWriter
impl DurableFileCacheWriter
Sourcepub fn new(file: File) -> Result<Self>
pub fn new(file: File) -> Result<Self>
Wrap file with the default 1 GiB durable cache window.
§Errors
Returns an error when the current descriptor offset cannot be observed.
Sourcepub fn with_window_bytes(file: File, window_bytes: NonZeroU64) -> Result<Self>
pub fn with_window_bytes(file: File, window_bytes: NonZeroU64) -> Result<Self>
Wrap file with an explicit non-zero durable cache window.
§Errors
Returns an error when the current descriptor offset cannot be observed.
Sourcepub fn with_window_bytes_checked(
file: File,
window_bytes: NonZeroU64,
setup_check: impl FnOnce() -> Result<()>,
) -> Result<Self>
pub fn with_window_bytes_checked( file: File, window_bytes: NonZeroU64, setup_check: impl FnOnce() -> Result<()>, ) -> Result<Self>
Wrap file and run one caller-supplied setup check after observing the
real descriptor offset but before constructing the writer.
This exists so higher layers can deterministically exercise constructor failure without bypassing the actual descriptor setup path.
§Errors
Returns an error when offset observation or setup_check fails.
Sourcepub fn sync_all_and_release(&mut self) -> Result<()>
pub fn sync_all_and_release(&mut self) -> Result<()>
Complete the final durability barrier and release its remaining cache window.
§Errors
Returns an error if synchronization or a supported cache-release request fails.
Sourcepub const fn evidence(&self) -> FileCacheReleaseEvidence
pub const fn evidence(&self) -> FileCacheReleaseEvidence
Return content-free synchronization and cache-release evidence.
Sourcepub const fn window_bytes(&self) -> NonZeroU64
pub const fn window_bytes(&self) -> NonZeroU64
Return this writer’s configured synchronization/release window.
Trait Implementations§
Source§impl Debug for DurableFileCacheWriter
impl Debug for DurableFileCacheWriter
Source§impl Write for DurableFileCacheWriter
impl Write for DurableFileCacheWriter
Source§fn write(&mut self, buffer: &[u8]) -> Result<usize>
fn write(&mut self, buffer: &[u8]) -> Result<usize>
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)