VfsFile

Trait VfsFile 

Source
pub trait VfsFile {
    // Required methods
    fn read(&self, buf: &mut [u8], offset: usize) -> Result<bool, VfsError>;
    fn write(&mut self, buf: &[u8], offset: usize) -> Result<(), VfsError>;
    fn truncate(&mut self, size: usize) -> Result<(), VfsError>;
    fn flush(&mut self) -> Result<(), VfsError>;
    fn size(&self) -> Result<usize, VfsError>;
}
Expand description

A trait defining the basic I/O capabilities required for a VFS file implementation.

Required Methods§

Source

fn read(&self, buf: &mut [u8], offset: usize) -> Result<bool, VfsError>

Abstraction of xRead, returns true for SQLITE_OK and false for SQLITE_IOERR_SHORT_READ

Source

fn write(&mut self, buf: &[u8], offset: usize) -> Result<(), VfsError>

Abstraction of xWrite

Source

fn truncate(&mut self, size: usize) -> Result<(), VfsError>

Abstraction of xTruncate

Source

fn flush(&mut self) -> Result<(), VfsError>

Abstraction of xSync

Source

fn size(&self) -> Result<usize, VfsError>

Abstraction of xFileSize

Implementors§