pub struct LocalStorage;
Expand description
A form of Storage
that stores the type with a wrapper that makes it Send + Sync
, but only
allows it to be accessed from the thread on which it was created.
Trait Implementations§
Source§impl Clone for LocalStorage
impl Clone for LocalStorage
Source§fn clone(&self) -> LocalStorage
fn clone(&self) -> LocalStorage
Returns a duplicate 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 moreSource§impl Debug for LocalStorage
impl Debug for LocalStorage
Source§impl<T> Storage<T> for LocalStoragewhere
T: 'static,
impl<T> Storage<T> for LocalStoragewhere
T: 'static,
Source§type Wrapped = SendWrapper<T>
type Wrapped = SendWrapper<T>
The type being stored, once it has been wrapped.
Source§fn try_with<U>(node: NodeId, fun: impl FnOnce(&T) -> U) -> Option<U>
fn try_with<U>(node: NodeId, fun: impl FnOnce(&T) -> U) -> Option<U>
Applies the given function to the stored value, if it exists and can be accessed from this
thread.
Source§fn try_with_mut<U>(node: NodeId, fun: impl FnOnce(&mut T) -> U) -> Option<U>
fn try_with_mut<U>(node: NodeId, fun: impl FnOnce(&mut T) -> U) -> Option<U>
Applies the given function to a mutable reference to the stored value, if it exists and can be accessed from this
thread.
impl Copy for LocalStorage
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<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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.