Trait gloo_storage::Storage
source · [−]pub trait Storage {
fn raw() -> Storage;
fn get<T>(key: impl AsRef<str>) -> Result<T>
where
T: for<'de> Deserialize<'de>,
{ ... }
fn get_all<T>() -> Result<T>
where
T: for<'a> Deserialize<'a>,
{ ... }
fn set<T>(key: impl AsRef<str>, value: T) -> Result<()>
where
T: Serialize,
{ ... }
fn delete(key: impl AsRef<str>) { ... }
fn clear() { ... }
fn length() -> u32 { ... }
}
Expand description
Trait which provides implementations for managing storage in the browser.
Required Methods
Get the raw web_sys::Storage
instance
Provided Methods
Get the value for the specified key
fn get_all<T>() -> Result<T> where
T: for<'a> Deserialize<'a>,
fn get_all<T>() -> Result<T> where
T: for<'a> Deserialize<'a>,
Get all the stored keys and their values
Insert a value for the specified key