pub trait LocalStorage {
// Required methods
fn set(
&self,
key: &str,
value: &[u8],
mode: StoreMode,
) -> Result<(), LocalStorageError>;
fn get(
&self,
key: &str,
) -> Result<Option<(Vec<u8>, u32)>, LocalStorageError>;
fn delete(&self, key: &str) -> Result<(), LocalStorageError>;
fn keys(&self) -> Vec<String>;
}Expand description
The LocalStorage trait defines the methods for storing and retrieving data.
Required Methods§
Sourcefn set(
&self,
key: &str,
value: &[u8],
mode: StoreMode,
) -> Result<(), LocalStorageError>
fn set( &self, key: &str, value: &[u8], mode: StoreMode, ) -> Result<(), LocalStorageError>
Sets the value of a key in the store with the particular StoreMode.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".