Trait Fetch

Source
pub trait Fetch<'s> {
    type Component: Component;
    type Iter: ExactSizeIterator + 's;

    // Required method
    unsafe fn fetch<S: Storage>(storage: &'s S) -> Self::Iter;
}
Expand description

A helper trait that works in lockstep with Read and Write to borrow components either mutable or immutable.

Required Associated Types§

Required Methods§

Source

unsafe fn fetch<S: Storage>(storage: &'s S) -> Self::Iter

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'s, C: Component> Fetch<'s> for Read<C>

Source§

type Component = C

Source§

type Iter = Iter<'s, C>

Source§

impl<'s, C: Component> Fetch<'s> for Write<C>

Source§

type Component = C

Source§

type Iter = IterMut<'s, C>