[−][src]Trait specs::Accessor
A trait for accessing read/write multiple resources from a system. This can be used to create dynamic systems that don't specify what they fetch at compile-time.
For compile-time system data this will all be done for you using
StaticAccessor
.
Required methods
fn try_new() -> Option<Self>
Tries to create a new instance of this type. This one returns Some
in
case there is a default, otherwise the system needs to override
System::accessor
.
fn reads(&self) -> Vec<ResourceId>
A list of ResourceId
s the bundle
needs read access to in order to
build the target resource bundle.
Contract
Exactly return the dependencies you're going to fetch
! Doing otherwise
will cause a panic.
This method is only executed once, thus the returned value may never change (otherwise it has no effect).
fn writes(&self) -> Vec<ResourceId>
A list of ResourceId
s the bundle
needs write access to in order to
build the target resource bundle.
Contract
Exactly return the dependencies you're going to fetch
! Doing otherwise
will cause a panic.
This method is only executed once, thus the returned value may never change (otherwise it has no effect).
Implementations on Foreign Types
impl<T> Accessor for PhantomData<T> where
T: ?Sized,
[src]
T: ?Sized,
fn try_new() -> Option<PhantomData<T>>
[src]
fn reads(&self) -> Vec<ResourceId>
[src]
fn writes(&self) -> Vec<ResourceId>
[src]
impl Accessor for ()
[src]
fn try_new() -> Option<()>
[src]
fn reads(&self) -> Vec<ResourceId>
[src]
fn writes(&self) -> Vec<ResourceId>
[src]
Implementors
impl Accessor for BatchAccessor
[src]
fn try_new() -> Option<BatchAccessor>
[src]
fn reads(&self) -> Vec<ResourceId>
[src]
fn writes(&self) -> Vec<ResourceId>
[src]
impl<'a, T> Accessor for StaticAccessor<T> where
T: SystemData<'a>,
[src]
T: SystemData<'a>,