pub trait Accessor: Sized {
// Provided methods
fn reads(&self) -> Vec<ResourceId> { ... }
fn writes(&self) -> Vec<ResourceId> { ... }
fn try_new() -> Option<Self> { ... }
}
Expand description
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
.
Provided Methods§
Sourcefn reads(&self) -> Vec<ResourceId>
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).
Sourcefn writes(&self) -> Vec<ResourceId>
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).
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.