pub struct LocalStorage { /* private fields */ }Expand description
LocalStorage-equivalent storage for Rust Provides a simple, persistent key-value store similar to browser localStorage Stores data in JSON files on disk in a single directory
This is similar to browser localStorage in that it:
- Persists data to disk
- Provides simple get/put/has operations
- Stores data in a user-accessible location
- Is simpler than a full database (like Sled)
Implementations§
Source§impl LocalStorage
impl LocalStorage
Trait Implementations§
Source§impl Drop for LocalStorage
impl Drop for LocalStorage
Source§impl Storage for LocalStorage
impl Storage for LocalStorage
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
soul: &'life1 str,
) -> Pin<Box<dyn Future<Output = GunResult<Option<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
soul: &'life1 str,
) -> Pin<Box<dyn Future<Output = GunResult<Option<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a node by its soul (unique identifier) Read more
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
soul: &'life1 str,
node: &'life2 Node,
) -> Pin<Box<dyn Future<Output = GunResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
soul: &'life1 str,
node: &'life2 Node,
) -> Pin<Box<dyn Future<Output = GunResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a node by its soul (unique identifier) Read more
Auto Trait Implementations§
impl !Freeze for LocalStorage
impl !RefUnwindSafe for LocalStorage
impl Send for LocalStorage
impl Sync for LocalStorage
impl Unpin for LocalStorage
impl UnwindSafe for LocalStorage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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