logo
pub trait SystemParam {
    type Fetch: for<'s, 'w> SystemParamFetch<'w, 's>;
}
Expand description

A parameter that can be used in a System.

Derive

This trait can be derived with the super::SystemParam macro. The only requirement is that every struct field must also implement SystemParam.

use std::marker::PhantomData;
use bevy_ecs::system::SystemParam;

#[derive(SystemParam)]
struct MyParam<'w, 's> {
    foo: Res<'w, usize>,
    #[system_param(ignore)]
    marker: PhantomData<&'s usize>,
}

fn my_system(param: MyParam) {
    // Access the resource through `param.foo`
}

Associated Types

Implementations on Foreign Types

Implementors