pub struct EntityVec<Idx: EntityRef, T: Clone + Debug>(/* private fields */);
Implementations§
Source§impl<Idx: EntityRef, T: Clone + Debug> EntityVec<Idx, T>
impl<Idx: EntityRef, T: Clone + Debug> EntityVec<Idx, T>
Sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = Idx>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = Idx>
Get an iterator over the index-space.
Sourcepub fn values(&self) -> impl DoubleEndedIterator<Item = &T>
pub fn values(&self) -> impl DoubleEndedIterator<Item = &T>
Get an iterator over (borrows of) entity values.
Sourcepub fn values_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut T>
pub fn values_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut T>
Get an iterator over (mutable borrows of) entity values.
Sourcepub fn entries(&self) -> impl DoubleEndedIterator<Item = (Idx, &T)>
pub fn entries(&self) -> impl DoubleEndedIterator<Item = (Idx, &T)>
Get an iterator over index, borrow-of-entity tuples.
Sourcepub fn entries_mut(&mut self) -> impl Iterator<Item = (Idx, &mut T)>
pub fn entries_mut(&mut self) -> impl Iterator<Item = (Idx, &mut T)>
Get an iterator over index, mutable-borrow-of-entity tuples.
Sourcepub fn get(&self, idx: Idx) -> Option<&T>
pub fn get(&self, idx: Idx) -> Option<&T>
Typesafe element access, returning None
if idx
is the
invalid index.
Trait Implementations§
Source§impl<'de, Idx: EntityRef, T> Deserialize<'de> for EntityVec<Idx, T>
impl<'de, Idx: EntityRef, T> Deserialize<'de> for EntityVec<Idx, T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<Idx, T> Freeze for EntityVec<Idx, T>
impl<Idx, T> RefUnwindSafe for EntityVec<Idx, T>where
Idx: RefUnwindSafe,
T: RefUnwindSafe,
impl<Idx, T> Send for EntityVec<Idx, T>
impl<Idx, T> Sync for EntityVec<Idx, T>
impl<Idx, T> Unpin for EntityVec<Idx, T>
impl<Idx, T> UnwindSafe for EntityVec<Idx, T>where
Idx: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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