Struct rin::ecs::operators::Sto[][src]

pub struct Sto<'a, S>(_, _)
where
    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> Sto<'a, S> where
    S: UnorderedData<'a>, 
[src]

pub fn new(
    storage: Option<<S as UnorderedData<'a>>::Storage>,
    entities: Entities<'a>
) -> Sto<'a, S>
[src]

pub fn unwrap(self) -> Sto<'a, S>[src]

impl<'a, 'r, S> Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: StorageRef<'r>,
    <S as UnorderedData<'a>>::Storage: ReadOnlyStorage
[src]

pub fn get(
    &'r self,
    entity: &Entity
) -> Option<<<S as UnorderedData<'a>>::Storage as StorageRef<'r>>::Component>
[src]

impl<'a, 'r, S> Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: StorageRef<'r>, 
[src]

pub fn get_mut(
    &'r mut self,
    entity: &Entity
) -> Option<<<S as UnorderedData<'a>>::Storage as StorageRef<'r>>::Component>
[src]

impl<'a, 'r, S> Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: OptionStorage<'r>,
    <S as UnorderedData<'a>>::Storage: IntoSendStorage<'r>,
    <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage: ReadOnlyStorage
[src]

pub fn iter(
    &'r self
) -> <<S as UnorderedData<'a>>::Storage as OptionStorage<'r>>::Iter
[src]

pub fn iter_for_entities<E>(
    &'r self,
    entities_iter: E
) -> <E as IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesIter where
    E: IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

pub fn iter_for_entities_opt<E>(
    &'r self,
    entities_iter: E
) -> <E as IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesOptIter where
    E: IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

pub fn as_send_storage(
    &'r self
) -> SendSto<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage> where
    <S as UnorderedData<'a>>::Storage: 'r, 
[src]

impl<'a, 'r, S> Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: OptionStorageMut<'r>,
    <S as UnorderedData<'a>>::Storage: IntoSendStorage<'r>, 
[src]

pub fn iter_mut(
    &'r mut self
) -> <<S as UnorderedData<'a>>::Storage as OptionStorageMut<'r>>::IterMut
[src]

pub fn iter_for_entities_mut<E>(
    &'r mut self,
    entities_iter: E
) -> <E as IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesIterMut where
    E: IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

pub fn iter_for_entities_opt_mut<E>(
    &'r mut self,
    entities_iter: E
) -> <E as IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesOptIterMut where
    E: IntoEntitiesIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

pub fn as_send_storage_mut(
    &'r mut self
) -> SendSto<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage> where
    <S as UnorderedData<'a>>::Storage: 'r, 
[src]

impl<'a, 'r, S> Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: ParOptionStorage<'r>,
    <S as UnorderedData<'a>>::Storage: IntoSendStorage<'r>,
    <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage: ReadOnlyStorage
[src]

pub fn par_iter(
    &'r self
) -> <<S as UnorderedData<'a>>::Storage as ParOptionStorage<'r>>::ParIter
[src]

pub fn par_iter_for_entities<E>(
    &'r self,
    entities_iter: E
) -> <E as IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesParIter where
    E: IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

pub fn par_iter_for_entities_opt<E>(
    &'r self,
    entities_iter: E
) -> <E as IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesOptParIter where
    E: IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

impl<'a, 'r, S> Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: ParOptionStorageMut<'r>,
    <S as UnorderedData<'a>>::Storage: IntoSendStorage<'r>, 
[src]

pub fn par_iter_mut(
    &'r mut self
) -> <<S as UnorderedData<'a>>::Storage as ParOptionStorageMut<'r>>::ParIterMut
[src]

pub fn par_iter_for_entities_mut<E>(
    &'r mut self,
    entities_iter: E
) -> <E as IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesParIterMut where
    E: IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

pub fn par_iter_for_entities_opt_mut<E>(
    &'r mut self,
    entities_iter: E
) -> <E as IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>>::IntoEntitiesOptParIterMut where
    E: IntoEntitiesParIterator<'r, <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage>, 
[src]

Trait Implementations

impl<'a, U1, U2, U3, U4, U5, U6, U7, U8> IntoStorages for Sto<'a, (U1, U2, U3, U4, U5, U6, U7, U8)> where
    U8: UnorderedData<'a>,
    U1: UnorderedData<'a>,
    U2: UnorderedData<'a>,
    U3: UnorderedData<'a>,
    U4: UnorderedData<'a>,
    U5: UnorderedData<'a>,
    U6: UnorderedData<'a>,
    U7: UnorderedData<'a>,
    <U1 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U3 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U3 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U4 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U4 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U5 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U5 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U6 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U6 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U7 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U7 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U8 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U8 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>, Sto<'a, U3>, Sto<'a, U4>, Sto<'a, U5>, Sto<'a, U6>, Sto<'a, U7>, Sto<'a, U8>)

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 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U3 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U3 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U4 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U4 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U5 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U5 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U6 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U6 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>, Sto<'a, U3>, Sto<'a, U4>, Sto<'a, U5>, Sto<'a, U6>)

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 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U3 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U3 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U4 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U4 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U5 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U5 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>, Sto<'a, U3>, Sto<'a, U4>, Sto<'a, U5>)

impl<'a, U1, U2> IntoStorages for Sto<'a, (U1, U2)> where
    U1: UnorderedData<'a>,
    U2: UnorderedData<'a>,
    <U1 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>)

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 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U3 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U3 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U4 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U4 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>, Sto<'a, U3>, Sto<'a, U4>)

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 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U3 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U3 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U4 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U4 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U5 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U5 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U6 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U6 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U7 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U7 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>, Sto<'a, U3>, Sto<'a, U4>, Sto<'a, U5>, Sto<'a, U6>, Sto<'a, U7>)

impl<'a, U1, U2, U3> IntoStorages for Sto<'a, (U1, U2, U3)> where
    U1: UnorderedData<'a>,
    U2: UnorderedData<'a>,
    U3: UnorderedData<'a>,
    <U1 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U1 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U2 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U2 as UnorderedData<'a>>::Storage: StorageRef<'a>,
    <U3 as UnorderedData<'a>>::Storage: FastIndexExt,
    <U3 as UnorderedData<'a>>::Storage: StorageRef<'a>, 
[src]

type Storages = (Sto<'a, U1>, Sto<'a, U2>, Sto<'a, U3>)

impl<'r, 'a, S> StorageEntitiesExt<'a, S> for &'r mut Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: StorageRef<'r>,
    <S as UnorderedData<'a>>::Storage: IntoSendStorage<'r>, 
[src]

type Component = <<S as UnorderedData<'a>>::Storage as StorageRef<'r>>::Component

type IntoStorage = <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage

impl<'a, 'r, S> StorageEntitiesExt<'a, S> for &'r Sto<'a, S> where
    S: UnorderedData<'a>,
    <S as UnorderedData<'a>>::Storage: StorageRef<'r>,
    <S as UnorderedData<'a>>::Storage: IntoSendStorage<'r>,
    <S as UnorderedData<'a>>::Storage: ReadOnlyStorage,
    <S as UnorderedData<'a>>::Storage: 'r, 
[src]

type Component = <<S as UnorderedData<'a>>::Storage as StorageRef<'r>>::Component

type IntoStorage = <<S as UnorderedData<'a>>::Storage as IntoSendStorage<'r>>::SendStorage

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

impl<'a, S> Sync for Sto<'a, S> where
    <S as UnorderedData<'a>>::Storage: Sync

impl<'a, S> Unpin for Sto<'a, S> where
    <S as UnorderedData<'a>>::Storage: Unpin

impl<'a, S> !UnwindSafe for Sto<'a, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Any + Send + Sync
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]