pub trait DurableFile:
Write
+ Send
+ Sync
+ Debug {
// Required methods
fn sync_data(&self) -> Result<()>;
fn sync_all(&self) -> Result<()>;
fn set_len(&self, size: u64) -> Result<()>;
}Expand description
A file a durable path appends to.
Write plus the three file operations a rewind needs. Boxed behind a
BufWriter where there is one, so the dynamic call happens once per
buffer flush rather than once per record.
Required Methods§
Sourcefn sync_data(&self) -> Result<()>
fn sync_data(&self) -> Result<()>
Flush the file’s data to stable storage.
§Errors
The underlying fsync error. A failure here is not recoverable by
retrying: on a failed fsync the kernel may discard the dirty pages
and clear the error, so a second call can succeed while the data is
gone. The caller poisons itself instead.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".