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 const fn new() -> OwnedStateMap<U>
pub const fn new() -> OwnedStateMap<U>
New default, empty.
Sourcepub fn remove<T>(&mut self, id: impl Into<StateId<T>>) -> Option<T>where
T: StateValue,
pub fn remove<T>(&mut self, id: impl Into<StateId<T>>) -> Option<T>where
T: StateValue,
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>
Source§impl<U> Default for OwnedStateMap<U>
impl<U> Default for OwnedStateMap<U>
Source§fn default() -> OwnedStateMap<U>
fn default() -> OwnedStateMap<U>
Returns the “default value” for a type. Read more
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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> 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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().