Struct specs::storage::PairedStorage
source · [−]pub struct PairedStorage<'rf, 'st: 'rf, C, S, B, Restrict> { /* private fields */ }
Expand description
Pairs a storage with an index, meaning that the index is guaranteed to exist
as long as the PairedStorage<C, S>
exists.
Implementations
sourceimpl<'rf, 'st, C, S, B, Restrict> PairedStorage<'rf, 'st, C, S, B, Restrict> where
C: Component,
S: Borrow<C::Storage>,
B: Borrow<BitSet>,
impl<'rf, 'st, C, S, B, Restrict> PairedStorage<'rf, 'st, C, S, B, Restrict> where
C: Component,
S: Borrow<C::Storage>,
B: Borrow<BitSet>,
sourcepub fn get_unchecked(&self) -> &C
pub fn get_unchecked(&self) -> &C
Gets the component related to the current entry without checking whether the storage has it or not.
sourceimpl<'rf, 'st, C, S, B, Restrict> PairedStorage<'rf, 'st, C, S, B, Restrict> where
C: Component,
S: BorrowMut<C::Storage>,
B: Borrow<BitSet>,
impl<'rf, 'st, C, S, B, Restrict> PairedStorage<'rf, 'st, C, S, B, Restrict> where
C: Component,
S: BorrowMut<C::Storage>,
B: Borrow<BitSet>,
sourcepub fn get_mut_unchecked(&mut self) -> &'_ mut C
pub fn get_mut_unchecked(&mut self) -> &'_ mut C
Gets the component related to the current entry without checking whether the storage has it or not.
sourceimpl<'rf, 'st, C, S, B, Restrict> PairedStorage<'rf, 'st, C, S, B, Restrict> where
C: Component,
S: Borrow<C::Storage>,
B: Borrow<BitSet>,
Restrict: ImmutableAliasing,
impl<'rf, 'st, C, S, B, Restrict> PairedStorage<'rf, 'st, C, S, B, Restrict> where
C: Component,
S: Borrow<C::Storage>,
B: Borrow<BitSet>,
Restrict: ImmutableAliasing,
sourceimpl<'rf, 'st, C, S, B> PairedStorage<'rf, 'st, C, S, B, SequentialRestriction> where
C: Component,
S: BorrowMut<C::Storage>,
B: Borrow<BitSet>,
impl<'rf, 'st, C, S, B> PairedStorage<'rf, 'st, C, S, B, SequentialRestriction> where
C: Component,
S: BorrowMut<C::Storage>,
B: Borrow<BitSet>,
sourcepub fn get_mut(&mut self, entity: Entity) -> Option<&'_ mut C>
pub fn get_mut(&mut self, entity: Entity) -> Option<&'_ mut C>
Attempts to get the component related to the entity mutably.
Functions similar to the normal Storage::get_mut
implementation.
This only works if this is a non-parallel RestrictedStorage
,
otherwise you could access the same component mutably in two different
threads.
Auto Trait Implementations
impl<'rf, 'st, C, S, B, Restrict> !RefUnwindSafe for PairedStorage<'rf, 'st, C, S, B, Restrict>
impl<'rf, 'st, C, S, B, Restrict> Send for PairedStorage<'rf, 'st, C, S, B, Restrict> where
B: Send,
C: Send,
Restrict: Send,
S: Send,
impl<'rf, 'st, C, S, B, Restrict> Sync for PairedStorage<'rf, 'st, C, S, B, Restrict> where
B: Sync,
C: Sync,
Restrict: Sync,
S: Sync,
impl<'rf, 'st, C, S, B, Restrict> Unpin for PairedStorage<'rf, 'st, C, S, B, Restrict> where
B: Unpin,
C: Unpin,
Restrict: Unpin,
S: Unpin,
'st: 'rf,
impl<'rf, 'st, C, S, B, Restrict> !UnwindSafe for PairedStorage<'rf, 'st, C, S, B, Restrict>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more