pub trait Vfs: Sync {
type Handle: DatabaseHandle;
// Required methods
fn open(&self, db: &str, opts: OpenOptions) -> Result<Self::Handle, Error>;
fn delete(&self, db: &str) -> Result<(), Error>;
fn exists(&self, db: &str) -> Result<bool, Error>;
fn temporary_name(&self) -> String;
fn random(&self, buffer: &mut [i8]);
fn sleep(&self, duration: Duration) -> Duration;
// Provided methods
fn access(&self, _db: &str, _write: bool) -> Result<bool, Error> { ... }
fn full_pathname<'a>(&self, db: &'a str) -> Result<Cow<'a, str>, Error> { ... }
}
Expand description
A virtual file system for SQLite.
Required Associated Types§
Sourcetype Handle: DatabaseHandle
type Handle: DatabaseHandle
The file returned by Vfs::open.
Required Methods§
Sourcefn open(&self, db: &str, opts: OpenOptions) -> Result<Self::Handle, Error>
fn open(&self, db: &str, opts: OpenOptions) -> Result<Self::Handle, Error>
Open the database db
(of type opts.kind
).
Sourcefn temporary_name(&self) -> String
fn temporary_name(&self) -> String
Generate and return a path for a temporary database.