pub trait AsyncSystem<'a>: Sized {
type SystemData: DynamicSystemData<'a>;
// Required method
fn run_async(&mut self, data: Self::SystemData) -> BoxFuture<'a, ()>;
// Provided methods
fn init(&mut self) { ... }
fn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self::SystemData> { ... }
fn setup(&mut self, world: &mut World) { ... }
fn dispose(self, world: &mut World)
where Self: Sized { ... }
}
Expand description
A System
, executed with a set of required Resource
s asynchronous.
Required Associated Types§
Sourcetype SystemData: DynamicSystemData<'a>
type SystemData: DynamicSystemData<'a>
The resource bundle required to execute a system.
You will mostly use a tuple of system data (which also implements
SystemData
). You can also create such a resource bundle by simply
deriving SystemData
for a struct.
Every SystemData
is also a DynamicSystemData
.
Required Methods§
Sourcefn run_async(&mut self, data: Self::SystemData) -> BoxFuture<'a, ()>
fn run_async(&mut self, data: Self::SystemData) -> BoxFuture<'a, ()>
Executes the system with the required system data asynchronous.
Provided Methods§
Sourcefn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self::SystemData>
fn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self::SystemData>
Return the accessor from the SystemData
.
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.