Skip to main content

VfsFile

Trait VfsFile 

Source
pub trait VfsFile: Send {
    // Required methods
    fn append(&mut self, bytes: &[u8]) -> Result<()>;
    fn sync(&self, kind: SyncKind) -> Result<()>;

    // Provided method
    fn append_vectored(&mut self, buffers: &mut [IoSlice<'_>]) -> Result<()> { ... }
}
Expand description

One open append-only file owned by a WAL writer.

Required Methods§

Source

fn append(&mut self, bytes: &[u8]) -> Result<()>

Appends every supplied byte without reopening the path.

Source

fn sync(&self, kind: SyncKind) -> Result<()>

Synchronizes this already-open handle using the named primitive.

Provided Methods§

Source

fn append_vectored(&mut self, buffers: &mut [IoSlice<'_>]) -> Result<()>

Appends one logical group from discontiguous owned buffers.

The default preserves compatibility for test filesystems. Production files override it with one vectored write sequence, so WAL visibility and persistence can share encoded record storage without coalescing it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§