pub struct Read<'a, T: 'a, F = DefaultProvider> { /* private fields */ }
Expand description
Allows to fetch a resource in a system immutably.
If the resource isn’t strictly required, you should use Option<Read<T>>
.
Type parameters
T
: The type of the resourceF
: The setup handler (default:DefaultProvider
)
Trait Implementations§
source§impl<'a, T, F> SystemData<'a> for Read<'a, T, F>where
T: Resource,
F: SetupHandler<T>,
impl<'a, T, F> SystemData<'a> for Read<'a, T, F>where
T: Resource,
F: SetupHandler<T>,
source§fn fetch(world: &'a World) -> Self
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.Auto Trait Implementations§
impl<'a, T, F = DefaultProvider> !RefUnwindSafe for Read<'a, T, F>
impl<'a, T, F> Send for Read<'a, T, F>
impl<'a, T, F> Sync for Read<'a, T, F>
impl<'a, T, F> Unpin for Read<'a, T, F>where
F: Unpin,
impl<'a, T, F = DefaultProvider> !UnwindSafe for Read<'a, T, F>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<'a, T> DynamicSystemData<'a> for Twhere
T: SystemData<'a>,
impl<'a, T> DynamicSystemData<'a> for Twhere
T: SystemData<'a>,
§type Accessor = StaticAccessor<T>
type Accessor = StaticAccessor<T>
The accessor of the
SystemData
, which specifies the read and write
dependencies and does the fetching.source§fn setup(_: &StaticAccessor<T>, world: &mut World)
fn setup(_: &StaticAccessor<T>, world: &mut World)
Sets up
World
for fetching this system data.