diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index a3d5872c8a..2fcdc33240 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -36,6 +36,35 @@ use std::{ /// Derived `SystemParam` structs may have two lifetimes: `'w` for data stored in the [`World`], /// and `'s` for data stored in the parameter's state. /// +/// The following list shows the most common [`SystemParam`]s and which lifetime they require +/// +/// ``` +/// # use bevy_ecs::prelude::*; +/// # #[derive(Resource)] +/// # struct SomeResource; +/// # #[derive(Event)] +/// # struct SomeEvent; +/// # #[derive(Resource)] +/// # struct SomeOtherResource; +/// # use bevy_ecs::system::SystemParam; +/// # #[derive(SystemParam)] +/// # struct ParamsExample<'w, 's> { +/// # query: +/// Query<'w, 's, Entity>, +/// # res: +/// Res<'w, SomeResource>, +/// # res_mut: +/// ResMut<'w, SomeOtherResource>, +/// # local: +/// Local<'s, u8>, +/// # commands: +/// Commands<'w, 's>, +/// # eventreader: +/// EventReader<'w, 's, SomeEvent>, +/// # eventwriter: +/// EventWriter<'w, SomeEvent> +/// # } +///``` /// ## `PhantomData` /// /// [`PhantomData`] is a special type of `SystemParam` that does nothing.