Struct mls_rs::storage_provider::sqlite::storage::SqLiteApplicationStorage
source · pub struct SqLiteApplicationStorage { /* private fields */ }
Available on crate feature
sqlite
only.Expand description
SQLite key-value storage for application specific data.
Implementations§
source§impl SqLiteApplicationStorage
impl SqLiteApplicationStorage
sourcepub fn insert(
&self,
key: String,
value: Vec<u8>
) -> Result<(), SqLiteDataStorageError>
pub fn insert( &self, key: String, value: Vec<u8> ) -> Result<(), SqLiteDataStorageError>
Insert value
into storage indexed by key
.
If a value already exists for key
it will be overwritten.
sourcepub fn get(&self, key: &str) -> Result<Option<Vec<u8>>, SqLiteDataStorageError>
pub fn get(&self, key: &str) -> Result<Option<Vec<u8>>, SqLiteDataStorageError>
Get a value from storage based on its key
.
sourcepub fn delete(&self, key: &str) -> Result<(), SqLiteDataStorageError>
pub fn delete(&self, key: &str) -> Result<(), SqLiteDataStorageError>
Delete a value from storage based on its key
.
sourcepub fn get_by_prefix(
&self,
key_prefix: &str
) -> Result<Vec<Item>, SqLiteDataStorageError>
pub fn get_by_prefix( &self, key_prefix: &str ) -> Result<Vec<Item>, SqLiteDataStorageError>
Get all keys and values from storage for which key starts with key_prefix
.
sourcepub fn delete_by_prefix(
&self,
key_prefix: &str
) -> Result<(), SqLiteDataStorageError>
pub fn delete_by_prefix( &self, key_prefix: &str ) -> Result<(), SqLiteDataStorageError>
Delete all values from storage for which key starts with key_prefix
.
Trait Implementations§
source§impl Clone for SqLiteApplicationStorage
impl Clone for SqLiteApplicationStorage
source§fn clone(&self) -> SqLiteApplicationStorage
fn clone(&self) -> SqLiteApplicationStorage
Returns a copy 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 RefUnwindSafe for SqLiteApplicationStorage
impl Send for SqLiteApplicationStorage
impl Sync for SqLiteApplicationStorage
impl Unpin for SqLiteApplicationStorage
impl UnwindSafe for SqLiteApplicationStorage
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