Skip to content

Commit

Permalink
Add std derives to SystemParam types
Browse files Browse the repository at this point in the history
  • Loading branch information
spectria-limina committed Dec 12, 2024
1 parent 0707c07 commit f7865ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/system/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ unsafe impl<'w, 's, D: QueryData + 'static, F: QueryFilter + 'static>
/// .build_state(&mut world)
/// .build_system(|query: Vec<Query<()>>| {});
/// ```
#[derive(Clone)]
pub struct QueryParamBuilder<T>(T);

impl<T> QueryParamBuilder<T> {
Expand Down Expand Up @@ -400,6 +401,7 @@ unsafe impl<P: SystemParam, B: SystemParamBuilder<P>> SystemParamBuilder<Vec<P>>
/// set.for_each(|mut query| for mut health in query.iter_mut() {});
/// }
/// ```
#[derive(Debug, Default, Copy, Clone)]
pub struct ParamSetBuilder<T>(pub T);

macro_rules! impl_param_set_builder_tuple {
Expand Down Expand Up @@ -519,6 +521,7 @@ unsafe impl<'a, 'w, 's> SystemParamBuilder<DynSystemParam<'w, 's>> for DynParamB
/// });
/// # world.run_system_once(system);
/// ```
#[derive(Default, Debug, Clone)]
pub struct LocalBuilder<T>(pub T);

// SAFETY: `Local` performs no world access.
Expand All @@ -536,6 +539,7 @@ unsafe impl<'s, T: FromWorld + Send + 'static> SystemParamBuilder<Local<'s, T>>

/// A [`SystemParamBuilder`] for a [`FilteredResources`].
/// See the [`FilteredResources`] docs for examples.
#[derive(Clone)]
pub struct FilteredResourcesParamBuilder<T>(T);

impl<T> FilteredResourcesParamBuilder<T> {
Expand Down Expand Up @@ -599,6 +603,7 @@ unsafe impl<'w, 's, T: FnOnce(&mut FilteredResourcesBuilder)>

/// A [`SystemParamBuilder`] for a [`FilteredResourcesMut`].
/// See the [`FilteredResourcesMut`] docs for examples.
#[derive(Clone)]
pub struct FilteredResourcesMutParamBuilder<T>(T);

impl<T> FilteredResourcesMutParamBuilder<T> {
Expand Down

0 comments on commit f7865ac

Please sign in to comment.