pub struct SqliteSaver { /* private fields */ }Expand description
SQLite-backed checkpoint saver.
Persists checkpoints to a SQLite database file with configurable
maximum checkpoint size. The database file is created with mode 0600
permissions on Unix systems.
Implementations§
Source§impl SqliteSaver
impl SqliteSaver
Sourcepub fn new(path: &Path) -> Result<Self, CheckpointError>
pub fn new(path: &Path) -> Result<Self, CheckpointError>
Create a new SqliteSaver at the given path.
Creates the database file (with 0600 permissions on Unix) and initialises the schema if it does not already exist.
§Errors
Returns CheckpointError::Storage if the database cannot be opened
or the schema cannot be created.
Sourcepub fn with_max_size(
path: &Path,
max_checkpoint_size: usize,
) -> Result<Self, CheckpointError>
pub fn with_max_size( path: &Path, max_checkpoint_size: usize, ) -> Result<Self, CheckpointError>
Create a new SqliteSaver with a custom maximum checkpoint size.
§Errors
Returns CheckpointError::Storage if the database cannot be opened
or the schema cannot be created.
Trait Implementations§
Source§impl BaseCheckpointSaver for SqliteSaver
impl BaseCheckpointSaver for SqliteSaver
Source§fn get_tuple<'a>(
&'a self,
config: &'a CheckpointConfig,
) -> BoxFuture<'a, Result<Option<CheckpointTuple>, CheckpointError>>
fn get_tuple<'a>( &'a self, config: &'a CheckpointConfig, ) -> BoxFuture<'a, Result<Option<CheckpointTuple>, CheckpointError>>
Retrieve a single checkpoint tuple matching the given configuration. Read more
Source§fn list<'a>(
&'a self,
config: &'a CheckpointConfig,
limit: Option<usize>,
) -> BoxFuture<'a, Result<Vec<CheckpointTuple>, CheckpointError>>
fn list<'a>( &'a self, config: &'a CheckpointConfig, limit: Option<usize>, ) -> BoxFuture<'a, Result<Vec<CheckpointTuple>, CheckpointError>>
List checkpoint tuples for the given configuration. Read more
Source§fn put<'a>(
&'a self,
config: &'a CheckpointConfig,
checkpoint: Checkpoint,
metadata: CheckpointMetadata,
) -> BoxFuture<'a, Result<CheckpointConfig, CheckpointError>>
fn put<'a>( &'a self, config: &'a CheckpointConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata, ) -> BoxFuture<'a, Result<CheckpointConfig, CheckpointError>>
Persist a checkpoint with its metadata. Read more
Source§impl Clone for SqliteSaver
impl Clone for SqliteSaver
Source§fn clone(&self) -> SqliteSaver
fn clone(&self) -> SqliteSaver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SqliteSaver
impl !RefUnwindSafe for SqliteSaver
impl Send for SqliteSaver
impl Sync for SqliteSaver
impl Unpin for SqliteSaver
impl UnsafeUnpin for SqliteSaver
impl !UnwindSafe for SqliteSaver
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