pub struct VecStorage<T>(/* private fields */);
Expand description
Vector storage. Uses a simple Vec
. Supposed to have maximum
performance for the components mostly present in entities.
as_slice()
and as_mut_slice()
indices correspond to
entity IDs. These can be compared to other VecStorage
s, to
other DefaultVecStorage
s, and to Entity::id()
s for live
entities.
Trait Implementations§
Source§impl<T> Default for VecStorage<T>
impl<T> Default for VecStorage<T>
Gets mutable access to the the data associated with an
Index
. Read moreSource§impl<T> SliceAccess<T> for VecStorage<T>
impl<T> SliceAccess<T> for VecStorage<T>
Source§impl<T> UnprotectedStorage<T> for VecStorage<T>
impl<T> UnprotectedStorage<T> for VecStorage<T>
Source§type AccessMut<'a> = &'a mut T
where
T: 'a
type AccessMut<'a> = &'a mut T where T: 'a
The wrapper through with mutable access of a component is performed.
Source§unsafe fn clean<B>(&mut self, has: B)where
B: BitSetLike,
unsafe fn clean<B>(&mut self, has: B)where
B: BitSetLike,
Clean the storage given a bitset with bits set for valid indices
dropping all existing components. Read more
Source§unsafe fn get(&self, id: Index) -> &T
unsafe fn get(&self, id: Index) -> &T
Gets a shared reference to the data associated with an
Index
. Read moreSource§unsafe fn get_mut(&mut self, id: Index) -> &mut T
unsafe fn get_mut(&mut self, id: Index) -> &mut T
Gets mutable access to the the data associated with an
Index
. Read moreimpl<T> DistinctStorage for VecStorage<T>
Auto Trait Implementations§
impl<T> Freeze for VecStorage<T>
impl<T> !RefUnwindSafe for VecStorage<T>
impl<T> Send for VecStorage<T>where
T: Send,
impl<T> Sync for VecStorage<T>where
T: Sync,
impl<T> Unpin for VecStorage<T>where
T: Unpin,
impl<T> UnwindSafe for VecStorage<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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
Source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
Source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.