Struct rinecs::operators::Sto [−][src]
pub struct Sto<'a, S: UnorderedData<'a>>(_, _);
Used as a argument in storages systems, wraps the storage for an operator or query
#[system_storages(name = "System")] fn system(mut pos: Sto<Write<Pos>>, vel: Sto<Read<Vel>>) { for (pos, vel) in (&mut pos, &vel).iter_mut(){ pos.0 += vel.0 } }
An Sto of any operator can be directly iterated calling iter on it or combined with other storages to iterate only over those entities that match the full query.
To combine bmore than one storage one can use a tuple of them or a tuple of references to them in case they’ll be used more than once. Write operators or tuple of operators need a mutable reference.
#[system_storages(name = "System")] fn system(mut pos: Sto<Write<Pos>>, vel: Sto<Read<Vel>>) { for (pos, vel) in (&mut pos, &vel).iter_mut(){ pos.0 += vel.0 } for pos in pos.iter_mut(){ // ... } }
Implementations
impl<'a, S: UnorderedData<'a>> Sto<'a, S>
[src]
impl<'a, S: UnorderedData<'a>> Sto<'a, S>
[src]impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r> + ReadOnlyStorage,
[src]
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r> + ReadOnlyStorage,
[src]impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r>,
[src]
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r>,
[src]impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: OptionStorage<'r>,
S::Storage: IntoSendStorage<'r>,
<S::Storage as IntoSendStorage<'r>>::SendStorage: ReadOnlyStorage,
[src]
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: OptionStorage<'r>,
S::Storage: IntoSendStorage<'r>,
<S::Storage as IntoSendStorage<'r>>::SendStorage: ReadOnlyStorage,
[src]pub fn iter(&'r self) -> <S::Storage as OptionStorage<'r>>::Iter
[src]
pub fn iter_for_entities<E>(&'r self, entities_iter: E) -> E::IntoEntitiesIter where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
pub fn iter_for_entities_opt<E>(
&'r self,
entities_iter: E
) -> E::IntoEntitiesOptIter where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r self,
entities_iter: E
) -> E::IntoEntitiesOptIter where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
pub fn as_send_storage(
&'r self
) -> SendSto<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage> where
S::Storage: 'r,
[src]
&'r self
) -> SendSto<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage> where
S::Storage: 'r,
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: OptionStorageMut<'r>,
S::Storage: IntoSendStorage<'r>,
[src]
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: OptionStorageMut<'r>,
S::Storage: IntoSendStorage<'r>,
[src]pub fn iter_mut(&'r mut self) -> <S::Storage as OptionStorageMut<'r>>::IterMut
[src]
pub fn iter_for_entities_mut<E>(
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesIterMut where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesIterMut where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
pub fn iter_for_entities_opt_mut<E>(
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesOptIterMut where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesOptIterMut where
E: IntoEntitiesIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
pub fn as_send_storage_mut(
&'r mut self
) -> SendSto<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage> where
S::Storage: 'r,
[src]
&'r mut self
) -> SendSto<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage> where
S::Storage: 'r,
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: ParOptionStorage<'r>,
S::Storage: IntoSendStorage<'r>,
<S::Storage as IntoSendStorage<'r>>::SendStorage: ReadOnlyStorage,
[src]
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: ParOptionStorage<'r>,
S::Storage: IntoSendStorage<'r>,
<S::Storage as IntoSendStorage<'r>>::SendStorage: ReadOnlyStorage,
[src]pub fn par_iter(&'r self) -> <S::Storage as ParOptionStorage<'r>>::ParIter
[src]
pub fn par_iter_for_entities<E>(
&'r self,
entities_iter: E
) -> E::IntoEntitiesParIter where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r self,
entities_iter: E
) -> E::IntoEntitiesParIter where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
pub fn par_iter_for_entities_opt<E>(
&'r self,
entities_iter: E
) -> E::IntoEntitiesOptParIter where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r self,
entities_iter: E
) -> E::IntoEntitiesOptParIter where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: ParOptionStorageMut<'r>,
S::Storage: IntoSendStorage<'r>,
[src]
impl<'a, 'r, S> Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: ParOptionStorageMut<'r>,
S::Storage: IntoSendStorage<'r>,
[src]pub fn par_iter_mut(
&'r mut self
) -> <S::Storage as ParOptionStorageMut<'r>>::ParIterMut
[src]
&'r mut self
) -> <S::Storage as ParOptionStorageMut<'r>>::ParIterMut
pub fn par_iter_for_entities_mut<E>(
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesParIterMut where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesParIterMut where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
pub fn par_iter_for_entities_opt_mut<E>(
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesOptParIterMut where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
[src]
&'r mut self,
entities_iter: E
) -> E::IntoEntitiesOptParIterMut where
E: IntoEntitiesParIterator<'r, <S::Storage as IntoSendStorage<'r>>::SendStorage>,
Trait Implementations
impl<'a, U1, U2> IntoStorages for Sto<'a, (U1, U2)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2> IntoStorages for Sto<'a, (U1, U2)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'a, U1, U2, U3> IntoStorages for Sto<'a, (U1, U2, U3)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2, U3> IntoStorages for Sto<'a, (U1, U2, U3)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'a, U1, U2, U3, U4> IntoStorages for Sto<'a, (U1, U2, U3, U4)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2, U3, U4> IntoStorages for Sto<'a, (U1, U2, U3, U4)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'a, U1, U2, U3, U4, U5> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2, U3, U4, U5> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'a, U1, U2, U3, U4, U5, U6> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U6: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
U6::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2, U3, U4, U5, U6> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U6: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
U6::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'a, U1, U2, U3, U4, U5, U6, U7> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6, U7)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U6: UnorderedData<'a>,
U7: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
U6::Storage: FastIndexExt + StorageRef<'a>,
U7::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2, U3, U4, U5, U6, U7> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6, U7)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U6: UnorderedData<'a>,
U7: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
U6::Storage: FastIndexExt + StorageRef<'a>,
U7::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'a, U1, U2, U3, U4, U5, U6, U7, U8> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6, U7, U8)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U6: UnorderedData<'a>,
U7: UnorderedData<'a>,
U8: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
U6::Storage: FastIndexExt + StorageRef<'a>,
U7::Storage: FastIndexExt + StorageRef<'a>,
U8::Storage: FastIndexExt + StorageRef<'a>,
[src]
impl<'a, U1, U2, U3, U4, U5, U6, U7, U8> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6, U7, U8)> where
U1: UnorderedData<'a>,
U2: UnorderedData<'a>,
U3: UnorderedData<'a>,
U4: UnorderedData<'a>,
U5: UnorderedData<'a>,
U6: UnorderedData<'a>,
U7: UnorderedData<'a>,
U8: UnorderedData<'a>,
U1::Storage: FastIndexExt + StorageRef<'a>,
U2::Storage: FastIndexExt + StorageRef<'a>,
U3::Storage: FastIndexExt + StorageRef<'a>,
U4::Storage: FastIndexExt + StorageRef<'a>,
U5::Storage: FastIndexExt + StorageRef<'a>,
U6::Storage: FastIndexExt + StorageRef<'a>,
U7::Storage: FastIndexExt + StorageRef<'a>,
U8::Storage: FastIndexExt + StorageRef<'a>,
[src]impl<'r, 'a, S> StorageEntitiesExt<'a, S> for &'r mut Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r> + IntoSendStorage<'r>,
[src]
impl<'r, 'a, S> StorageEntitiesExt<'a, S> for &'r mut Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r> + IntoSendStorage<'r>,
[src]type Component = <S::Storage as StorageRef<'r>>::Component
type IntoStorage = <S::Storage as IntoSendStorage<'r>>::SendStorage
fn into_storage(self) -> Option<Self::IntoStorage>
[src]
fn entities(&self) -> &Entities<'a>
[src]
fn get(self, entity: &Entity) -> Option<Self::Component>
[src]
impl<'a, 'r, S> StorageEntitiesExt<'a, S> for &'r Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r> + IntoSendStorage<'r> + ReadOnlyStorage + 'r,
[src]
impl<'a, 'r, S> StorageEntitiesExt<'a, S> for &'r Sto<'a, S> where
S: UnorderedData<'a>,
S::Storage: StorageRef<'r> + IntoSendStorage<'r> + ReadOnlyStorage + 'r,
[src]type Component = <S::Storage as StorageRef<'r>>::Component
type IntoStorage = <S::Storage as IntoSendStorage<'r>>::SendStorage
fn into_storage(self) -> Option<Self::IntoStorage>
[src]
fn entities(&self) -> &Entities<'a>
[src]
fn get(self, entity: &Entity) -> Option<Self::Component>
[src]
impl<'a, S> StorageWrapper for Sto<'a, S> where
S: UnorderedData<'a>,
[src]
impl<'a, S> StorageWrapper for Sto<'a, S> where
S: UnorderedData<'a>,
[src]type Storage = <S as UnorderedData<'a>>::Storage
type Data = S
Auto Trait Implementations
impl<'a, S> !RefUnwindSafe for Sto<'a, S>
impl<'a, S> Send for Sto<'a, S> where
<S as UnorderedData<'a>>::Storage: Send,
<S as UnorderedData<'a>>::Storage: Send,
impl<'a, S> Sync for Sto<'a, S> where
<S as UnorderedData<'a>>::Storage: Sync,
<S as UnorderedData<'a>>::Storage: Sync,
impl<'a, S> Unpin for Sto<'a, S> where
<S as UnorderedData<'a>>::Storage: Unpin,
<S as UnorderedData<'a>>::Storage: Unpin,