Struct zng_state_map::OwnedStateMap
source · 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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