Type Alias shred::ReadExpect

source ·
pub type ReadExpect<'a, T> = Read<'a, T, PanicHandler>;
Expand description

Allows to fetch a resource in a system immutably. This will panic if the resource does not exist. Usage of Read or Option<Read> is therefore recommended.

Aliased Type§

struct ReadExpect<'a, T> { /* private fields */ }

Trait Implementations§

source§

impl<'a, T, F> Deref for Read<'a, T, F>where T: Resource,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<'a, T, F> From<Fetch<'a, T>> for Read<'a, T, F>

source§

fn from(inner: Fetch<'a, T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T, F> SystemData<'a> for Read<'a, T, F>where T: Resource, F: SetupHandler<T>,

source§

fn setup(world: &mut World)

Sets up the system data for fetching it from the World.
source§

fn fetch(world: &'a World) -> Self

Fetches the system data from World. Note that this is only specified for one concrete lifetime 'a, you need to implement the SystemData trait for every possible lifetime.
source§

fn reads() -> Vec<ResourceId>

Returns all read dependencies as fetched from Self::fetch. Read more
source§

fn writes() -> Vec<ResourceId>

Returns all write dependencies as fetched from Self::fetch. Read more