pub struct SqliteBackend { /* private fields */ }Implementations§
Source§impl SqliteBackend
impl SqliteBackend
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, BackendError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, BackendError>
Opens a connection to the SQLite database.
Uses SqliteOptions::default for SQLite pragmas and cross-process
change detection.
§Errors
Returns BackendError::Open when the database cannot be opened,
SQLite pragmas cannot be applied, or the settings table cannot be
created.
Sourcepub fn open_with_options(
path: impl AsRef<Path>,
options: SqliteOptions,
) -> Result<Self, BackendError>
pub fn open_with_options( path: impl AsRef<Path>, options: SqliteOptions, ) -> Result<Self, BackendError>
Opens a connection to the SQLite database with explicit backend options.
Applies the configured SQLite pragmas, creates the settings table, and
starts the cross-process watcher when options.cross_process is true.
§Errors
Returns BackendError::Open when the database cannot be opened,
SQLite pragmas cannot be applied, or the settings table cannot be
created.
Trait Implementations§
Source§impl Drop for SqliteBackend
impl Drop for SqliteBackend
Source§impl StorageBackend for SqliteBackend
impl StorageBackend for SqliteBackend
Source§fn load_all(&self) -> Result<HashMap<String, StoredValue>, BackendError>
fn load_all(&self) -> Result<HashMap<String, StoredValue>, BackendError>
Load all persisted settings into memory. This method is called at load and on
watcher ticks.
Source§fn set(&self, key: &str, value: &StoredValue) -> Result<(), BackendError>
fn set(&self, key: &str, value: &StoredValue) -> Result<(), BackendError>
Persist a setting to the database. Read more
Auto Trait Implementations§
impl !Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl !UnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnsafeUnpin for SqliteBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more