pub struct LocalStore { /* private fields */ }Implementations§
Source§impl LocalStore
impl LocalStore
pub fn new(prefix: Option<&str>, async_storage: AsyncStorageSync) -> Self
pub fn sub_store(&self, sub_key: &str) -> LocalStore
pub async fn set(&mut self, key: &str, value: String) -> Result<(), BuckyError>
pub async fn set_obj<T>( &mut self, key: &str, value: &T, ) -> Result<(), BuckyError>
pub async fn get(&mut self, key: &str) -> Option<String>
pub async fn get_obj<T>(&mut self, key: &str) -> Result<Option<T>, BuckyError>where
T: DeserializeOwned,
pub async fn remove(&mut self, key: &str) -> Option<()>
pub async fn remove_obj<T>(
&mut self,
key: &str,
) -> Result<Option<()>, BuckyError>where
T: DeserializeOwned,
pub async fn clear(&mut self)
Auto Trait Implementations§
impl Freeze for LocalStore
impl !RefUnwindSafe for LocalStore
impl Send for LocalStore
impl Sync for LocalStore
impl Unpin for LocalStore
impl !UnwindSafe for LocalStore
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> 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