diff --git a/crates/bevy_ecs/src/event/event_cursor.rs b/crates/bevy_ecs/src/event/event_cursor.rs index 1081298cf4e25..4868197712a6e 100644 --- a/crates/bevy_ecs/src/event/event_cursor.rs +++ b/crates/bevy_ecs/src/event/event_cursor.rs @@ -58,6 +58,9 @@ pub type ManualEventReader = EventCursor; /// /// # bevy_ecs::system::assert_is_system(send_and_receive_events); /// ``` +/// +/// [`EventReader`]: super::EventReader +/// [`EventMutator`]: super::EventMutator #[derive(Debug)] pub struct EventCursor { pub(super) last_event_count: usize, @@ -84,22 +87,22 @@ impl Clone for EventCursor { #[allow(clippy::len_without_is_empty)] // Check fails since the is_empty implementation has a signature other than `(&self) -> bool` impl EventCursor { - /// See [`EventReader::read`] + /// See [`EventReader::read`](super::EventReader::read) pub fn read<'a>(&'a mut self, events: &'a Events) -> EventIterator<'a, E> { self.read_with_id(events).without_id() } - /// See [`EventMutator::read`] + /// See [`EventMutator::read`](super::EventMutator::read) pub fn read_mut<'a>(&'a mut self, events: &'a mut Events) -> EventMutIterator<'a, E> { self.read_mut_with_id(events).without_id() } - /// See [`EventReader::read_with_id`] + /// See [`EventReader::read_with_id`](super::EventReader::read_with_id) pub fn read_with_id<'a>(&'a mut self, events: &'a Events) -> EventIteratorWithId<'a, E> { EventIteratorWithId::new(self, events) } - /// See [`EventMutator::read_with_id`] + /// See [`EventMutator::read_with_id`](super::EventMutator::read_with_id) pub fn read_mut_with_id<'a>( &'a mut self, events: &'a mut Events, @@ -107,19 +110,19 @@ impl EventCursor { EventMutIteratorWithId::new(self, events) } - /// See [`EventReader::par_read`] + /// See [`EventReader::par_read`](super::EventReader::par_read) #[cfg(feature = "multi_threaded")] pub fn par_read<'a>(&'a mut self, events: &'a Events) -> EventParIter<'a, E> { EventParIter::new(self, events) } - /// See [`EventMutator::par_read`] + /// See [`EventMutator::par_read`](super::EventMutator::par_read) #[cfg(feature = "multi_threaded")] pub fn par_read_mut<'a>(&'a mut self, events: &'a mut Events) -> EventMutParIter<'a, E> { EventMutParIter::new(self, events) } - /// See [`EventReader::len`] + /// See [`EventReader::len`](super::EventReader::len) pub fn len(&self, events: &Events) -> usize { // The number of events in this reader is the difference between the most recent event // and the last event seen by it. This will be at most the number of events contained @@ -138,12 +141,12 @@ impl EventCursor { .saturating_sub(self.last_event_count) } - /// See [`EventReader::is_empty()`] + /// See [`EventReader::is_empty()`](super::EventReader::is_empty) pub fn is_empty(&self, events: &Events) -> bool { self.len(events) == 0 } - /// See [`EventReader::clear()`] + /// See [`EventReader::clear()`](super::EventReader::clear) pub fn clear(&mut self, events: &Events) { self.last_event_count = events.event_count; } diff --git a/crates/bevy_ecs/src/event/mut_iterators.rs b/crates/bevy_ecs/src/event/mut_iterators.rs index 677ae2e1067aa..490503af7eb53 100644 --- a/crates/bevy_ecs/src/event/mut_iterators.rs +++ b/crates/bevy_ecs/src/event/mut_iterators.rs @@ -6,6 +6,8 @@ use bevy_utils::detailed_trace; use std::{iter::Chain, slice::IterMut}; /// An iterator that yields any unread events from an [`EventMutator`] or [`EventCursor`]. +/// +/// [`EventMutator`]: super::EventMutator #[derive(Debug)] pub struct EventMutIterator<'a, E: Event> { iter: EventMutIteratorWithId<'a, E>, @@ -44,6 +46,8 @@ impl<'a, E: Event> ExactSizeIterator for EventMutIterator<'a, E> { } /// An iterator that yields any unread events (and their IDs) from an [`EventMutator`] or [`EventCursor`]. +/// +/// [`EventMutator`]: super::EventMutator #[derive(Debug)] pub struct EventMutIteratorWithId<'a, E: Event> { mutator: &'a mut EventCursor, diff --git a/crates/bevy_ecs/src/event/mutator.rs b/crates/bevy_ecs/src/event/mutator.rs index bf518a2768eb8..faa350138f5eb 100644 --- a/crates/bevy_ecs/src/event/mutator.rs +++ b/crates/bevy_ecs/src/event/mutator.rs @@ -40,6 +40,8 @@ use bevy_ecs::{ /// Most of the time systems will want to use [`EventMutator::read()`]. This function creates an iterator over /// all events that haven't been read yet by this system, marking the event as read in the process. /// +/// [`EventReader`]: super::EventReader +/// [`EventWriter`]: super::EventWriter #[derive(SystemParam, Debug)] pub struct EventMutator<'w, 's, E: Event> { pub(super) reader: Local<'s, EventCursor>, @@ -54,13 +56,13 @@ impl<'w, 's, E: Event> EventMutator<'w, 's, E> { self.reader.read_mut(&mut self.events) } - /// Like [`read`](Self::read), except also returning the [`EventId`] of the events. + /// Like [`read`](Self::read), except also returning the [`EventId`](super::EventId) of the events. pub fn read_with_id(&mut self) -> EventMutIteratorWithId<'_, E> { self.reader.read_mut_with_id(&mut self.events) } /// Returns a parallel iterator over the events this [`EventMutator`] has not seen yet. - /// See also [`for_each`](EventParIter::for_each). + /// See also [`for_each`](super::EventParIter::for_each). /// /// # Example /// ``` diff --git a/crates/bevy_reflect/src/func/args/info.rs b/crates/bevy_reflect/src/func/args/info.rs index b7330dedb2f9b..baf85e0207918 100644 --- a/crates/bevy_reflect/src/func/args/info.rs +++ b/crates/bevy_reflect/src/func/args/info.rs @@ -5,8 +5,8 @@ use crate::TypePath; /// Type information for an [`Arg`] used in a [`DynamicFunction`]. /// -/// [`Arg`]: crate::func::args::Arg -/// [`DynamicFunction`]: super::function::DynamicFunction +/// [`Arg`]: crate::func::Arg +/// [`DynamicFunction`]: crate::func::DynamicFunction #[derive(Debug, Clone)] pub struct ArgInfo { /// The index of the argument within its function. @@ -57,6 +57,7 @@ impl ArgInfo { /// For [`DynamicFunctions`] created using [`IntoFunction`], the name will always be `None`. /// /// [`DynamicFunctions`]: crate::func::DynamicFunction + /// [`IntoFunction`]: crate::func::IntoFunction pub fn name(&self) -> Option<&str> { self.name.as_deref() } diff --git a/crates/bevy_reflect/src/func/info.rs b/crates/bevy_reflect/src/func/info.rs index 2e4c985cf2f73..49c0789c58551 100644 --- a/crates/bevy_reflect/src/func/info.rs +++ b/crates/bevy_reflect/src/func/info.rs @@ -56,6 +56,7 @@ impl FunctionInfo { /// the name will always be the full path to the function as returned by [`std::any::type_name`]. /// /// [`DynamicFunctions`]: crate::func::DynamicFunction + /// [`IntoFunction`]: crate::func::IntoFunction pub fn name(&self) -> Option<&str> { self.name.as_deref() } diff --git a/crates/bevy_text/src/font_atlas.rs b/crates/bevy_text/src/font_atlas.rs index aa426c67e5550..b5e0dfb575f7e 100644 --- a/crates/bevy_text/src/font_atlas.rs +++ b/crates/bevy_text/src/font_atlas.rs @@ -21,7 +21,7 @@ use crate::{GlyphAtlasLocation, TextError}; /// providing a trade-off between visual quality and performance. /// /// A [`CacheKey`](cosmic_text::CacheKey) encodes all of the information of a subpixel-offset glyph and is used to -/// find that glyphs raster in a [`TextureAtlas`] through its corresponding [`GlyphAtlasLocation`]. +/// find that glyphs raster in a [`TextureAtlas`](bevy_sprite::TextureAtlas) through its corresponding [`GlyphAtlasLocation`]. pub struct FontAtlas { /// Used to update the [`TextureAtlasLayout`]. pub dynamic_texture_atlas_builder: DynamicTextureAtlasBuilder, diff --git a/crates/bevy_text/src/font_loader.rs b/crates/bevy_text/src/font_loader.rs index adc5cc69c0763..999e7fa75a23a 100644 --- a/crates/bevy_text/src/font_loader.rs +++ b/crates/bevy_text/src/font_loader.rs @@ -3,7 +3,7 @@ use bevy_asset::{io::Reader, AssetLoader, LoadContext}; use thiserror::Error; #[derive(Default)] -/// An [`AssetLoader`] for [`Font`]s, for use by the [`AssetServer`] +/// An [`AssetLoader`] for [`Font`]s, for use by the [`AssetServer`](bevy_asset::AssetServer) pub struct FontLoader; /// Possible errors that can be produced by [`FontLoader`] diff --git a/crates/bevy_text/src/glyph.rs b/crates/bevy_text/src/glyph.rs index ba949efbfd000..3efd1ac8afe90 100644 --- a/crates/bevy_text/src/glyph.rs +++ b/crates/bevy_text/src/glyph.rs @@ -56,11 +56,11 @@ impl PositionedGlyph { pub struct GlyphAtlasInfo { /// A handle to the [`Image`] data for the texture atlas this glyph was placed in. /// - /// A (weak) clone of the handle held by the [`FontAtlas`]. + /// A (weak) clone of the handle held by the [`FontAtlas`](crate::FontAtlas). pub texture: Handle, /// A handle to the [`TextureAtlasLayout`] map for the texture atlas this glyph was placed in. /// - /// A (weak) clone of the handle held by the [`FontAtlas`]. + /// A (weak) clone of the handle held by the [`FontAtlas`](crate::FontAtlas). pub texture_atlas: Handle, /// Location and offset of a glyph within the texture atlas. pub location: GlyphAtlasLocation, diff --git a/crates/bevy_text/src/lib.rs b/crates/bevy_text/src/lib.rs index 0550883f13830..d5c4527e0b11d 100644 --- a/crates/bevy_text/src/lib.rs +++ b/crates/bevy_text/src/lib.rs @@ -20,7 +20,7 @@ //! Note that text measurement is only relevant in a UI context. //! //! With the actual text bounds defined, the `bevy_ui::widget::text::text_system` system (in a UI context) -//! or [`bevy_text::text2d::update_text2d_layout`] system (in a 2d world space context) +//! or [`text2d::update_text2d_layout`] system (in a 2d world space context) //! passes it into [`TextPipeline::queue_text`], which: //! //! 1. creates a [`Buffer`](cosmic_text::Buffer) from the [`TextSection`]s, generating new [`FontAtlasSet`]s if necessary. diff --git a/crates/bevy_text/src/pipeline.rs b/crates/bevy_text/src/pipeline.rs index 7f7004e71ee04..325460b8b1ab5 100644 --- a/crates/bevy_text/src/pipeline.rs +++ b/crates/bevy_text/src/pipeline.rs @@ -358,7 +358,7 @@ fn load_font_to_fontdb( }); } -/// Translates [`TextSection`] to [`Attrs`](cosmic_text::attrs::Attrs), +/// Translates [`TextSection`] to [`Attrs`], /// loading fonts into the [`Database`](cosmic_text::fontdb::Database) if required. fn get_attrs<'a>( section: &TextSection,