FilteredEntitySystem

Trait FilteredEntitySystem 

Source
pub trait FilteredEntitySystem: System {
    // Required method
    fn create_aspect() -> Aspect<Self::Components>;
}
Expand description

This trait is implemented automatically when you #[derive(System)] with the following:

#[derive(System, Default)]
#[system_type(entity)]
#[aspect = "some::aspect::UnitStruct"]
#[process(process)]
struct MySystem;

or

#[derive(System, Default)]
#[system_type(entity)]
#[aspect(all(foo))]
#[process = "process"]
struct MySystem;

type DataHelper = conniecs::DataHelper<Components, Services>;
fn process(_: &mut MySystem, entities: EntityIter<Components>, data: &mut DataHelper) {
    for entity in entities {
        println!("boop the {}", &data.components.foo[entity]);
    }
}

Required Methods§

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.

Implementors§