Skip to content

Commit 4c1678c

Browse files
committed
Hide docs for concrete impls of Fetch, FetchState, and SystemParamState (#4250)
# Objective The following pages in the docs are rather noisy, and the types they point to are not particularly useful by themselves: - http://dev-docs.bevyengine.org/bevy/ecs/query/index.html - http://dev-docs.bevyengine.org/bevy/ecs/system/index.html ## Solution - Replace docs on these types with `#[doc(hidden)]`. - Hide `InputMarker` too.
1 parent 31636a3 commit 4c1678c

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

crates/bevy_ecs/src/query/fetch.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ impl WorldQuery for Entity {
413413
}
414414

415415
/// The [`Fetch`] of [`Entity`].
416+
#[doc(hidden)]
416417
#[derive(Clone)]
417418
pub struct EntityFetch {
418419
entities: *const Entity,
@@ -422,6 +423,7 @@ pub struct EntityFetch {
422423
unsafe impl ReadOnlyFetch for EntityFetch {}
423424

424425
/// The [`FetchState`] of [`Entity`].
426+
#[doc(hidden)]
425427
pub struct EntityState;
426428

427429
// SAFETY: no component or archetype access
@@ -500,6 +502,7 @@ impl<T: Component> WorldQuery for &T {
500502
}
501503

502504
/// The [`FetchState`] of `&T`.
505+
#[doc(hidden)]
503506
pub struct ReadState<T> {
504507
component_id: ComponentId,
505508
marker: PhantomData<T>,
@@ -547,6 +550,7 @@ unsafe impl<T: Component> FetchState for ReadState<T> {
547550
}
548551

549552
/// The [`Fetch`] of `&T`.
553+
#[doc(hidden)]
550554
pub struct ReadFetch<T> {
551555
table_components: NonNull<T>,
552556
entity_table_rows: *const usize,
@@ -656,6 +660,7 @@ impl<T: Component> WorldQuery for &mut T {
656660
}
657661

658662
/// The [`Fetch`] of `&mut T`.
663+
#[doc(hidden)]
659664
pub struct WriteFetch<T> {
660665
table_components: NonNull<T>,
661666
table_ticks: *const UnsafeCell<ComponentTicks>,
@@ -681,6 +686,7 @@ impl<T> Clone for WriteFetch<T> {
681686
}
682687

683688
/// The [`ReadOnlyFetch`] of `&mut T`.
689+
#[doc(hidden)]
684690
pub struct ReadOnlyWriteFetch<T> {
685691
table_components: NonNull<T>,
686692
entities: *const Entity,
@@ -703,6 +709,7 @@ impl<T> Clone for ReadOnlyWriteFetch<T> {
703709
}
704710

705711
/// The [`FetchState`] of `&mut T`.
712+
#[doc(hidden)]
706713
pub struct WriteState<T> {
707714
component_id: ComponentId,
708715
marker: PhantomData<T>,
@@ -940,6 +947,7 @@ impl<T: WorldQuery> WorldQuery for Option<T> {
940947
}
941948

942949
/// The [`Fetch`] of `Option<T>`.
950+
#[doc(hidden)]
943951
#[derive(Clone)]
944952
pub struct OptionFetch<T> {
945953
fetch: T,
@@ -950,6 +958,7 @@ pub struct OptionFetch<T> {
950958
unsafe impl<T: ReadOnlyFetch> ReadOnlyFetch for OptionFetch<T> {}
951959

952960
/// The [`FetchState`] of `Option<T>`.
961+
#[doc(hidden)]
953962
pub struct OptionState<T: FetchState> {
954963
state: T,
955964
}
@@ -1116,6 +1125,7 @@ impl<T: Component> WorldQuery for ChangeTrackers<T> {
11161125
}
11171126

11181127
/// The [`FetchState`] of [`ChangeTrackers`].
1128+
#[doc(hidden)]
11191129
pub struct ChangeTrackersState<T> {
11201130
component_id: ComponentId,
11211131
marker: PhantomData<T>,
@@ -1163,6 +1173,7 @@ unsafe impl<T: Component> FetchState for ChangeTrackersState<T> {
11631173
}
11641174

11651175
/// The [`Fetch`] of [`ChangeTrackers`].
1176+
#[doc(hidden)]
11661177
pub struct ChangeTrackersFetch<T> {
11671178
table_ticks: *const ComponentTicks,
11681179
entity_table_rows: *const usize,

crates/bevy_ecs/src/query/filter.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ impl<T: Component> WorldQuery for With<T> {
7979
}
8080

8181
/// The [`Fetch`] of [`With`].
82+
#[doc(hidden)]
8283
pub struct WithFetch<T> {
8384
marker: PhantomData<T>,
8485
}
8586

8687
/// The [`FetchState`] of [`With`].
88+
#[doc(hidden)]
8789
pub struct WithState<T> {
8890
component_id: ComponentId,
8991
marker: PhantomData<T>,
@@ -202,11 +204,13 @@ impl<T: Component> WorldQuery for Without<T> {
202204
}
203205

204206
/// The [`Fetch`] of [`Without`].
207+
#[doc(hidden)]
205208
pub struct WithoutFetch<T> {
206209
marker: PhantomData<T>,
207210
}
208211

209212
/// The [`FetchState`] of [`Without`].
213+
#[doc(hidden)]
210214
pub struct WithoutState<T> {
211215
component_id: ComponentId,
212216
marker: PhantomData<T>,
@@ -325,6 +329,7 @@ unsafe impl<T> ReadOnlyFetch for WithoutFetch<T> {}
325329
pub struct Or<T>(pub T);
326330

327331
/// The [`Fetch`] of [`Or`].
332+
#[doc(hidden)]
328333
pub struct OrFetch<T: FilterFetch> {
329334
fetch: T,
330335
matches: bool,
@@ -458,6 +463,7 @@ macro_rules! impl_tick_filter {
458463
$(#[$meta])*
459464
pub struct $name<T>(PhantomData<T>);
460465

466+
#[doc(hidden)]
461467
$(#[$fetch_meta])*
462468
pub struct $fetch_name<T> {
463469
table_ticks: *const UnsafeCell<ComponentTicks>,
@@ -469,6 +475,7 @@ macro_rules! impl_tick_filter {
469475
change_tick: u32,
470476
}
471477

478+
#[doc(hidden)]
472479
$(#[$state_meta])*
473480
pub struct $state_name<T> {
474481
component_id: ComponentId,

crates/bevy_ecs/src/system/function_system.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ impl<In, Out, Sys: System<In = In, Out = Out>> IntoSystem<In, Out, AlreadyWasSys
308308
/// }
309309
/// ```
310310
pub struct In<In>(pub In);
311+
#[doc(hidden)]
311312
pub struct InputMarker;
312313

313314
/// The [`System`] counter part of an ordinary function.

crates/bevy_ecs/src/system/system_param.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ pub struct QuerySet<'w, 's, T> {
181181
change_tick: u32,
182182
}
183183

184+
#[doc(hidden)]
184185
pub struct QuerySetState<T>(T);
185186

186187
impl_query_set!();
@@ -265,6 +266,7 @@ impl<'w, T: Resource> From<ResMut<'w, T>> for Res<'w, T> {
265266
}
266267

267268
/// The [`SystemParamState`] of [`Res<T>`].
269+
#[doc(hidden)]
268270
pub struct ResState<T> {
269271
component_id: ComponentId,
270272
marker: PhantomData<T>,
@@ -332,6 +334,7 @@ impl<'w, 's, T: Resource> SystemParamFetch<'w, 's> for ResState<T> {
332334

333335
/// The [`SystemParamState`] of [`Option<Res<T>>`].
334336
/// See: [`Res<T>`]
337+
#[doc(hidden)]
335338
pub struct OptionResState<T>(ResState<T>);
336339

337340
impl<'a, T: Resource> SystemParam for Option<Res<'a, T>> {
@@ -369,6 +372,7 @@ impl<'w, 's, T: Resource> SystemParamFetch<'w, 's> for OptionResState<T> {
369372
}
370373

371374
/// The [`SystemParamState`] of [`ResMut<T>`].
375+
#[doc(hidden)]
372376
pub struct ResMutState<T> {
373377
component_id: ComponentId,
374378
marker: PhantomData<T>,
@@ -441,6 +445,7 @@ impl<'w, 's, T: Resource> SystemParamFetch<'w, 's> for ResMutState<T> {
441445

442446
/// The [`SystemParamState`] of [`Option<ResMut<T>>`].
443447
/// See: [`ResMut<T>`]
448+
#[doc(hidden)]
444449
pub struct OptionResMutState<T>(ResMutState<T>);
445450

446451
impl<'a, T: Resource> SystemParam for Option<ResMut<'a, T>> {
@@ -512,6 +517,7 @@ impl<'w, 's> SystemParamFetch<'w, 's> for CommandQueue {
512517
unsafe impl ReadOnlySystemParamFetch for WorldState {}
513518

514519
/// The [`SystemParamState`] of [`&World`](crate::world::World).
520+
#[doc(hidden)]
515521
pub struct WorldState;
516522

517523
impl<'w, 's> SystemParam for &'w World {
@@ -631,6 +637,7 @@ impl<'a, T: Resource> DerefMut for Local<'a, T> {
631637
}
632638

633639
/// The [`SystemParamState`] of [`Local<T>`].
640+
#[doc(hidden)]
634641
pub struct LocalState<T: Resource>(T);
635642

636643
impl<'a, T: Resource + FromWorld> SystemParam for Local<'a, T> {
@@ -707,6 +714,7 @@ impl<'a, T: Component> RemovedComponents<'a, T> {
707714
unsafe impl<T: Component> ReadOnlySystemParamFetch for RemovedComponentsState<T> {}
708715

709716
/// The [`SystemParamState`] of [`RemovedComponents<T>`].
717+
#[doc(hidden)]
710718
pub struct RemovedComponentsState<T> {
711719
component_id: ComponentId,
712720
marker: PhantomData<T>,
@@ -810,6 +818,7 @@ impl<'a, T> From<NonSendMut<'a, T>> for NonSend<'a, T> {
810818
}
811819

812820
/// The [`SystemParamState`] of [`NonSend<T>`].
821+
#[doc(hidden)]
813822
pub struct NonSendState<T> {
814823
component_id: ComponentId,
815824
marker: PhantomData<fn() -> T>,
@@ -881,6 +890,7 @@ impl<'w, 's, T: 'static> SystemParamFetch<'w, 's> for NonSendState<T> {
881890

882891
/// The [`SystemParamState`] of [`Option<NonSend<T>>`].
883892
/// See: [`NonSend<T>`]
893+
#[doc(hidden)]
884894
pub struct OptionNonSendState<T>(NonSendState<T>);
885895

886896
impl<'w, T: 'static> SystemParam for Option<NonSend<'w, T>> {
@@ -919,6 +929,7 @@ impl<'w, 's, T: 'static> SystemParamFetch<'w, 's> for OptionNonSendState<T> {
919929
}
920930

921931
/// The [`SystemParamState`] of [`NonSendMut<T>`].
932+
#[doc(hidden)]
922933
pub struct NonSendMutState<T> {
923934
component_id: ComponentId,
924935
marker: PhantomData<fn() -> T>,
@@ -994,6 +1005,7 @@ impl<'w, 's, T: 'static> SystemParamFetch<'w, 's> for NonSendMutState<T> {
9941005

9951006
/// The [`SystemParamState`] of [`Option<NonSendMut<T>>`].
9961007
/// See: [`NonSendMut<T>`]
1008+
#[doc(hidden)]
9971009
pub struct OptionNonSendMutState<T>(NonSendMutState<T>);
9981010

9991011
impl<'a, T: 'static> SystemParam for Option<NonSendMut<'a, T>> {
@@ -1038,6 +1050,7 @@ impl<'a> SystemParam for &'a Archetypes {
10381050
unsafe impl ReadOnlySystemParamFetch for ArchetypesState {}
10391051

10401052
/// The [`SystemParamState`] of [`Archetypes`].
1053+
#[doc(hidden)]
10411054
pub struct ArchetypesState;
10421055

10431056
// SAFE: no component value access
@@ -1069,6 +1082,7 @@ impl<'a> SystemParam for &'a Components {
10691082
unsafe impl ReadOnlySystemParamFetch for ComponentsState {}
10701083

10711084
/// The [`SystemParamState`] of [`Components`].
1085+
#[doc(hidden)]
10721086
pub struct ComponentsState;
10731087

10741088
// SAFE: no component value access
@@ -1100,6 +1114,7 @@ impl<'a> SystemParam for &'a Entities {
11001114
unsafe impl ReadOnlySystemParamFetch for EntitiesState {}
11011115

11021116
/// The [`SystemParamState`] of [`Entities`].
1117+
#[doc(hidden)]
11031118
pub struct EntitiesState;
11041119

11051120
// SAFE: no component value access
@@ -1131,6 +1146,7 @@ impl<'a> SystemParam for &'a Bundles {
11311146
unsafe impl ReadOnlySystemParamFetch for BundlesState {}
11321147

11331148
/// The [`SystemParamState`] of [`Bundles`].
1149+
#[doc(hidden)]
11341150
pub struct BundlesState;
11351151

11361152
// SAFE: no component value access
@@ -1154,6 +1170,7 @@ impl<'w, 's> SystemParamFetch<'w, 's> for BundlesState {
11541170
}
11551171
}
11561172

1173+
/// The [`SystemParamState`] of [`SystemChangeTick`].
11571174
#[derive(Debug)]
11581175
pub struct SystemChangeTick {
11591176
pub last_change_tick: u32,
@@ -1168,6 +1185,7 @@ impl SystemParam for SystemChangeTick {
11681185
}
11691186

11701187
/// The [`SystemParamState`] of [`SystemChangeTick`].
1188+
#[doc(hidden)]
11711189
pub struct SystemChangeTickState {}
11721190

11731191
unsafe impl SystemParamState for SystemChangeTickState {
@@ -1330,7 +1348,8 @@ impl<'w, 's, P: SystemParam> StaticSystemParam<'w, 's, P> {
13301348
}
13311349
}
13321350

1333-
/// The [`SystemParamState`] of [`SystemChangeTick`].
1351+
/// The [`SystemParamState`] of [`StaticSystemParam`].
1352+
#[doc(hidden)]
13341353
pub struct StaticSystemParamState<S, P>(S, PhantomData<fn() -> P>);
13351354

13361355
// Safe: This doesn't add any more reads, and the delegated fetch confirms it

0 commit comments

Comments
 (0)