Struct veloren_common::store::Store
source · pub struct Store<T> {
items: Vec<T>,
}
Fields§
§items: Vec<T>
Implementations§
source§impl<T> Store<T>
impl<T> Store<T>
pub fn get(&self, id: Id<T>) -> &T
pub fn get_mut(&mut self, id: Id<T>) -> &mut T
pub fn ids(&self) -> impl Iterator<Item = Id<T>>
pub fn values(&self) -> impl ExactSizeIterator<Item = &T>
pub fn values_mut(&mut self) -> impl ExactSizeIterator<Item = &mut T>
pub fn iter(&self) -> impl Iterator<Item = (Id<T>, &T)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (Id<T>, &mut T)>
pub fn insert(&mut self, item: T) -> Id<T>
pub fn recreate_id(&self, i: u64) -> Option<Id<T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Store<T>
impl<T> RefUnwindSafe for Store<T>where
T: RefUnwindSafe,
impl<T> Send for Store<T>where
T: Send,
impl<T> Sync for Store<T>where
T: Sync,
impl<T> Unpin for Store<T>where
T: Unpin,
impl<T> UnwindSafe for Store<T>where
T: UnwindSafe,
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§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.