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: &str,
value: &[u8],
) -> Result<(), SqLiteDataStorageError>
pub fn insert( &self, key: &str, value: &[u8], ) -> Result<(), SqLiteDataStorageError>
Insert value
into storage indexed by key
.
If a value already exists for key
it will be overwritten.
sourcepub fn transact_insert(
&self,
items: &[Item],
) -> Result<(), SqLiteDataStorageError>
pub fn transact_insert( &self, items: &[Item], ) -> Result<(), SqLiteDataStorageError>
Execute multiple SqLiteApplicationStorage::insert
operations in a transaction.
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 Freeze for SqLiteApplicationStorage
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more