pub struct OwnedStateMap<U>(/* private fields */);Expand description
Private state map.
The owner of a state map has full access including to the remove and clear methods that are not
provided in the StateMapMut type. All mutable references borrowed from this map are also protected to
not allow replacement.
The U parameter is tag type that represents the map’s context.
Implementations§
Source§impl<U> OwnedStateMap<U>
impl<U> OwnedStateMap<U>
Sourcepub fn remove<T: StateValue>(&mut self, id: impl Into<StateId<T>>) -> Option<T>
pub fn remove<T: StateValue>(&mut self, id: impl Into<StateId<T>>) -> Option<T>
Remove the key.
Sourcepub fn borrow(&self) -> StateMapRef<'_, U>
pub fn borrow(&self) -> StateMapRef<'_, U>
Create tagged read-only reference to the map.
Sourcepub fn borrow_mut(&mut self) -> StateMapMut<'_, U>
pub fn borrow_mut(&mut self) -> StateMapMut<'_, U>
Crate tagged mutable reference to the map.
Trait Implementations§
Source§impl<U> Debug for OwnedStateMap<U>
impl<U> Debug for OwnedStateMap<U>
Auto Trait Implementations§
impl<U> Freeze for OwnedStateMap<U>
impl<U> !RefUnwindSafe for OwnedStateMap<U>
impl<U> Send for OwnedStateMap<U>where
U: Send,
impl<U> Sync for OwnedStateMap<U>where
U: Sync,
impl<U> Unpin for OwnedStateMap<U>where
U: Unpin,
impl<U> !UnwindSafe for OwnedStateMap<U>
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> 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> 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