diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 22a6462d2b..545d4599ba 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -315,7 +315,7 @@ fn find_bone( Some(current_entity) } -/// Verify that there are no ancestors of a given entity that have an `AnimationPlayer`. +/// Verify that there are no ancestors of a given entity that have an [`AnimationPlayer`]. fn verify_no_ancestor_player( player_parent: Option<&Parent>, parents: &Query<(Option>, Option<&Parent>)>, diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 33cc26ca73..404ed09a49 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -160,7 +160,7 @@ impl SubApp { } } - /// Runs the `SubApp`'s default schedule. + /// Runs the [`SubApp`]'s default schedule. pub fn run(&mut self) { self.app.world.run_schedule(&*self.app.main_schedule_label); self.app.world.clear_trackers(); @@ -672,7 +672,7 @@ impl App { } } - /// Boxed variant of `add_plugin`, can be used from a [`PluginGroup`] + /// Boxed variant of [`add_plugin`](App::add_plugin) that can be used from a [`PluginGroup`] pub(crate) fn add_boxed_plugin( &mut self, plugin: Box, diff --git a/crates/bevy_asset/src/asset_server.rs b/crates/bevy_asset/src/asset_server.rs index e456c7eb44..de6108ffab 100644 --- a/crates/bevy_asset/src/asset_server.rs +++ b/crates/bevy_asset/src/asset_server.rs @@ -14,7 +14,7 @@ use parking_lot::{Mutex, RwLock}; use std::{path::Path, sync::Arc}; use thiserror::Error; -/// Errors that occur while loading assets with an `AssetServer`. +/// Errors that occur while loading assets with an [`AssetServer`]. #[derive(Error, Debug)] pub enum AssetServerError { /// Asset folder is not a directory. diff --git a/crates/bevy_asset/src/assets.rs b/crates/bevy_asset/src/assets.rs index 3fffa1d413..ac830ef6d2 100644 --- a/crates/bevy_asset/src/assets.rs +++ b/crates/bevy_asset/src/assets.rs @@ -276,7 +276,7 @@ pub trait AddAsset { where T: Asset; - /// Registers the asset type `T` using `[App::register]`, + /// Registers the asset type `T` using [`App::register_type`], /// and adds [`ReflectAsset`] type data to `T` and [`ReflectHandle`] type data to [`Handle`] in the type registry. /// /// This enables reflection code to access assets. For detailed information, see the docs on [`ReflectAsset`] and [`ReflectHandle`]. @@ -296,7 +296,7 @@ pub trait AddAsset { /// Adds an asset loader `T` using default values. /// - /// The default values may come from the `World` or from `T::default()`. + /// The default values may come from the [`World`] or from `T::default()`. fn init_asset_loader(&mut self) -> &mut Self where T: AssetLoader + FromWorld; @@ -306,7 +306,7 @@ pub trait AddAsset { /// Internal assets (e.g. shaders) are bundled directly into the app and can't be hot reloaded /// using the conventional API. See `DebugAssetServerPlugin`. /// - /// The default values may come from the `World` or from `T::default()`. + /// The default values may come from the [`World`] or from `T::default()`. fn init_debug_asset_loader(&mut self) -> &mut Self where T: AssetLoader + FromWorld; @@ -407,7 +407,7 @@ impl AddAsset for App { /// Loads an internal asset. /// /// Internal assets (e.g. shaders) are bundled directly into the app and can't be hot reloaded -/// using the conventional API. See `DebugAssetServerPlugin`. +/// using the conventional API. See [`DebugAssetServerPlugin`](crate::debug_asset_server::DebugAssetServerPlugin). #[cfg(feature = "debug_asset_server")] #[macro_export] macro_rules! load_internal_asset { diff --git a/crates/bevy_asset/src/io/android_asset_io.rs b/crates/bevy_asset/src/io/android_asset_io.rs index bcd0adada7..4da0b6d5f1 100644 --- a/crates/bevy_asset/src/io/android_asset_io.rs +++ b/crates/bevy_asset/src/io/android_asset_io.rs @@ -11,9 +11,9 @@ use std::{ /// /// Implementation details: /// -/// - `load_path` uses the [AssetManager] to load files. -/// - `read_directory` always returns an empty iterator. -/// - `get_metadata` will probably return an error. +/// - [`load_path`](AssetIo::load_path) uses the [`AssetManager`] to load files. +/// - [`read_directory`](AssetIo::read_directory) always returns an empty iterator. +/// - [`get_metadata`](AssetIo::get_metadata) will probably return an error. /// - Watching for changes is not supported. The watcher methods will do nothing. /// /// [AssetManager]: https://developer.android.com/reference/android/content/res/AssetManager diff --git a/crates/bevy_asset/src/io/file_asset_io.rs b/crates/bevy_asset/src/io/file_asset_io.rs index 61003e2249..867b9ed4d0 100644 --- a/crates/bevy_asset/src/io/file_asset_io.rs +++ b/crates/bevy_asset/src/io/file_asset_io.rs @@ -82,7 +82,7 @@ impl FileAssetIo { /// Returns the root directory where assets are loaded from. /// - /// See `get_base_path`. + /// See [`get_base_path`](FileAssetIo::get_base_path). pub fn root_path(&self) -> &PathBuf { &self.root_path } diff --git a/crates/bevy_asset/src/io/mod.rs b/crates/bevy_asset/src/io/mod.rs index 67ea2ff8e4..5a11e887dc 100644 --- a/crates/bevy_asset/src/io/mod.rs +++ b/crates/bevy_asset/src/io/mod.rs @@ -67,7 +67,7 @@ pub trait AssetIo: Downcast + Send + Sync + 'static { /// Tells the asset I/O to watch for changes recursively at the provided path. /// - /// No-op if `watch_for_changes` hasn't been called yet. + /// No-op if [`watch_for_changes`](AssetIo::watch_for_changes) hasn't been called yet. /// Otherwise triggers a reload each time `to_watch` changes. /// In most cases the asset found at the watched path should be changed, /// but when an asset depends on data at another path, the asset's path diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index 412ecad3bc..1fa2f7d59f 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -80,7 +80,7 @@ impl Default for AssetPlugin { } impl AssetPlugin { - /// Creates an instance of the platform's default `AssetIo`. + /// Creates an instance of the platform's default [`AssetIo`]. /// /// This is useful when providing a custom `AssetIo` instance that needs to /// delegate to the default `AssetIo` for the platform. diff --git a/crates/bevy_asset/src/reflect.rs b/crates/bevy_asset/src/reflect.rs index 2dc5de3dcb..e053b1de81 100644 --- a/crates/bevy_asset/src/reflect.rs +++ b/crates/bevy_asset/src/reflect.rs @@ -7,7 +7,8 @@ use crate::{Asset, Assets, Handle, HandleId, HandleUntyped}; /// Type data for the [`TypeRegistry`](bevy_reflect::TypeRegistry) used to operate on reflected [`Asset`]s. /// -/// This type provides similar methods to [`Assets`] like `get`, `add` and `remove`, but can be used in situations where you don't know which asset type `T` you want +/// This type provides similar methods to [`Assets`] like [`get`](ReflectAsset::get), +/// [`add`](ReflectAsset::add) and [`remove`](ReflectAsset::remove), but can be used in situations where you don't know which asset type `T` you want /// until runtime. /// /// [`ReflectAsset`] can be obtained via [`TypeRegistration::data`](bevy_reflect::TypeRegistration::data) if the asset was registered using [`register_asset_reflect`](crate::AddAsset::register_asset_reflect). diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index b5f7105c8f..daa81ad980 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -34,7 +34,7 @@ use std::path::PathBuf; #[cfg(not(target_arch = "wasm32"))] use bevy_tasks::tick_global_task_pools_on_main_thread; -/// Registration of default types to the `TypeRegistry` resource. +/// Registration of default types to the [`TypeRegistry`](bevy_reflect::TypeRegistry) resource. #[derive(Default)] pub struct TypeRegistrationPlugin; @@ -99,7 +99,8 @@ fn register_math_types(app: &mut App) { .register_type::(); } -/// Setup of default task pools: `AsyncComputeTaskPool`, `ComputeTaskPool`, `IoTaskPool`. +/// Setup of default task pools: [`AsyncComputeTaskPool`](bevy_tasks::AsyncComputeTaskPool), +/// [`ComputeTaskPool`](bevy_tasks::ComputeTaskPool), [`IoTaskPool`](bevy_tasks::IoTaskPool). #[derive(Default)] pub struct TaskPoolPlugin { /// Options for the [`TaskPool`](bevy_tasks::TaskPool) created at application start. diff --git a/crates/bevy_core_pipeline/src/prepass/mod.rs b/crates/bevy_core_pipeline/src/prepass/mod.rs index 8a6301a311..93bcebe031 100644 --- a/crates/bevy_core_pipeline/src/prepass/mod.rs +++ b/crates/bevy_core_pipeline/src/prepass/mod.rs @@ -61,10 +61,10 @@ pub struct MotionVectorPrepass; #[derive(Component)] pub struct ViewPrepassTextures { /// The depth texture generated by the prepass. - /// Exists only if [`DepthPrepass`] is added to the `ViewTarget` + /// Exists only if [`DepthPrepass`] is added to the [`ViewTarget`](bevy_render::view::ViewTarget) pub depth: Option, /// The normals texture generated by the prepass. - /// Exists only if [`NormalPrepass`] is added to the `ViewTarget` + /// Exists only if [`NormalPrepass`] is added to the [`ViewTarget`](bevy_render::view::ViewTarget) pub normal: Option, /// The motion vectors texture generated by the prepass. /// Exists only if [`MotionVectorPrepass`] is added to the `ViewTarget` diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs index f2839c1267..0dcbe44581 100644 --- a/crates/bevy_ecs/src/entity/mod.rs +++ b/crates/bevy_ecs/src/entity/mod.rs @@ -148,7 +148,7 @@ impl Entity { /// // ... replace the entities with valid ones. /// ``` /// - /// Deriving `Reflect` for a component that has an `Entity` field: + /// Deriving [`Reflect`](bevy_reflect::Reflect) for a component that has an `Entity` field: /// /// ```no_run /// # use bevy_ecs::{prelude::*, component::*}; @@ -301,15 +301,15 @@ pub struct Entities { /// that have been freed or are in the process of being allocated: /// /// - The `freelist` IDs, previously freed by `free()`. These IDs are available to any of - /// `alloc()`, `reserve_entity()` or `reserve_entities()`. Allocation will always prefer + /// [`alloc`], [`reserve_entity`] or [`reserve_entities`]. Allocation will always prefer /// these over brand new IDs. /// /// - The `reserved` list of IDs that were once in the freelist, but got reserved by - /// `reserve_entities` or `reserve_entity()`. They are now waiting for `flush()` to make them + /// [`reserve_entities`] or [`reserve_entity`]. They are now waiting for [`flush`] to make them /// fully allocated. /// /// - The count of new IDs that do not yet exist in `self.meta`, but which we have handed out - /// and reserved. `flush()` will allocate room for them in `self.meta`. + /// and reserved. [`flush`] will allocate room for them in `self.meta`. /// /// The contents of `pending` look like this: /// @@ -331,7 +331,12 @@ pub struct Entities { /// This formulation allows us to reserve any number of IDs first from the freelist /// and then from the new IDs, using only a single atomic subtract. /// - /// Once `flush()` is done, `free_cursor` will equal `pending.len()`. + /// Once [`flush`] is done, `free_cursor` will equal `pending.len()`. + /// + /// [`alloc`]: Entities::alloc + /// [`reserve_entity`]: Entities::reserve_entity + /// [`reserve_entities`]: Entities::reserve_entities + /// [`flush`]: Entities::flush pending: Vec, free_cursor: AtomicIdCursor, /// Stores the number of free entities for [`len`](Entities::len) @@ -350,7 +355,7 @@ impl Entities { /// Reserve entity IDs concurrently. /// - /// Storage for entity generation and location is lazily allocated by calling `flush`. + /// Storage for entity generation and location is lazily allocated by calling [`flush`](Entities::flush). pub fn reserve_entities(&self, count: u32) -> ReserveEntitiesIterator { // Use one atomic subtract to grab a range of new IDs. The range might be // entirely nonnegative, meaning all IDs come from the freelist, or entirely @@ -626,8 +631,8 @@ impl Entities { *self.free_cursor.get_mut() != self.pending.len() as IdCursor } - /// Allocates space for entities previously reserved with `reserve_entity` or - /// `reserve_entities`, then initializes each one using the supplied function. + /// Allocates space for entities previously reserved with [`reserve_entity`](Entities::reserve_entity) or + /// [`reserve_entities`](Entities::reserve_entities), then initializes each one using the supplied function. /// /// # Safety /// Flush _must_ set the entity location to the correct [`ArchetypeId`] for the given [`Entity`] diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index 2e531493eb..67a65ee64e 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -55,7 +55,7 @@ pub mod prelude { pub use bevy_utils::all_tuples; -/// A specialized hashmap type with Key of `TypeId` +/// A specialized hashmap type with Key of [`TypeId`] type TypeIdMap = rustc_hash::FxHashMap; #[cfg(test)] diff --git a/crates/bevy_ecs/src/query/access.rs b/crates/bevy_ecs/src/query/access.rs index b75f658b4b..706df3b8fd 100644 --- a/crates/bevy_ecs/src/query/access.rs +++ b/crates/bevy_ecs/src/query/access.rs @@ -147,7 +147,7 @@ impl Access { /// Returns `true` if the access and `other` can be active at the same time. /// - /// `Access` instances are incompatible if one can write + /// [`Access`] instances are incompatible if one can write /// an element that the other can read or write. pub fn is_compatible(&self, other: &Access) -> bool { // Only systems that do not write data are compatible with systems that operate on `&World`. @@ -218,7 +218,7 @@ impl Access { /// - `Query<&mut T>` read/write `T` /// - `Query>` accesses nothing /// -/// See comments the `WorldQuery` impls of `AnyOf`/`Option`/`Or` for more information. +/// See comments the [`WorldQuery`](super::WorldQuery) impls of [`AnyOf`](super::AnyOf)/`Option`/[`Or`](super::Or) for more information. #[derive(Debug, Clone, Eq, PartialEq)] pub struct FilteredAccess { access: Access, @@ -438,7 +438,7 @@ impl FilteredAccessSet { /// compatible. /// 2. A "fine grained" check, it kicks in when the "coarse" check fails. /// the two access sets might still be compatible if some of the accesses - /// are restricted with the `With` or `Without` filters so that access is + /// are restricted with the [`With`](super::With) or [`Without`](super::Without) filters so that access is /// mutually exclusive. The fine grained phase iterates over all filters in /// the `self` set and compares it to all the filters in the `other` set, /// making sure they are all mutually compatible. diff --git a/crates/bevy_ecs/src/schedule/executor/mod.rs b/crates/bevy_ecs/src/schedule/executor/mod.rs index 5de07a52f5..15c2f1536e 100644 --- a/crates/bevy_ecs/src/schedule/executor/mod.rs +++ b/crates/bevy_ecs/src/schedule/executor/mod.rs @@ -47,7 +47,7 @@ pub enum ExecutorKind { /// (along with dependency information for multi-threaded execution). /// /// Since the arrays are sorted in the same order, elements are referenced by their index. -/// `FixedBitSet` is used as a smaller, more efficient substitute of `HashSet`. +/// [`FixedBitSet`] is used as a smaller, more efficient substitute of `HashSet`. #[derive(Default)] pub struct SystemSchedule { pub(super) systems: Vec, diff --git a/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs index dbf8386a81..f6ba57e532 100644 --- a/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs +++ b/crates/bevy_ecs/src/schedule/executor/multi_threaded.rs @@ -56,7 +56,7 @@ impl SyncUnsafeSchedule<'_> { /// Per-system data used by the [`MultiThreadedExecutor`]. // Copied here because it can't be read from the system when it's running. struct SystemTaskMetadata { - /// The `ArchetypeComponentId` access of the system. + /// The [`ArchetypeComponentId`] access of the system. archetype_component_access: Access, /// Indices of the systems that directly depend on the system. dependents: Vec, diff --git a/crates/bevy_ecs/src/storage/blob_vec.rs b/crates/bevy_ecs/src/storage/blob_vec.rs index 47719db867..6875b14cc7 100644 --- a/crates/bevy_ecs/src/storage/blob_vec.rs +++ b/crates/bevy_ecs/src/storage/blob_vec.rs @@ -11,7 +11,7 @@ use bevy_utils::OnDrop; /// A flat, type-erased data storage type /// /// Used to densely store homogeneous ECS data. A blob is usually just an arbitrary block of contiguous memory without any identity, and -/// could be used to represent any arbitrary data (i.e. string, arrays, etc). This type is an extendable and reallcatable blob, which makes +/// could be used to represent any arbitrary data (i.e. string, arrays, etc). This type is an extendable and re-allocatable blob, which makes /// it a blobby Vec, a `BlobVec`. pub(super) struct BlobVec { item_layout: Layout, diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 8a4a81dbc3..06271dc22c 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -184,7 +184,7 @@ impl<'w, 's> Commands<'w, 's> { /// Pushes a [`Command`] to the queue for creating a new [`Entity`] if the given one does not exists, /// and returns its corresponding [`EntityCommands`]. /// - /// This method silently fails by returning `EntityCommands` + /// This method silently fails by returning [`EntityCommands`] /// even if the given `Entity` cannot be spawned. /// /// See [`World::get_or_spawn`] for more details. @@ -345,7 +345,7 @@ impl<'w, 's> Commands<'w, 's> { /// Pushes a [`Command`] to the queue for creating entities with a particular [`Bundle`] type. /// - /// `bundles_iter` is a type that can be converted into a `Bundle` iterator + /// `bundles_iter` is a type that can be converted into a [`Bundle`] iterator /// (it can also be a collection). /// /// This method is equivalent to iterating `bundles_iter` diff --git a/crates/bevy_ecs/src/system/function_system.rs b/crates/bevy_ecs/src/system/function_system.rs index 0ea8d3f339..27593cfef9 100644 --- a/crates/bevy_ecs/src/system/function_system.rs +++ b/crates/bevy_ecs/src/system/function_system.rs @@ -489,7 +489,7 @@ where } } -/// SAFETY: `F`'s param is `ReadOnlySystemParam`, so this system will only read from the world. +/// SAFETY: `F`'s param is [`ReadOnlySystemParam`], so this system will only read from the world. unsafe impl ReadOnlySystem for FunctionSystem where Marker: 'static, diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 943bb04c7f..f270e85105 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -63,7 +63,7 @@ pub struct World { pub(crate) storages: Storages, pub(crate) bundles: Bundles, pub(crate) removed_components: RemovedComponentEvents, - /// Access cache used by [WorldCell]. Is only accessed in the `Drop` impl of `WorldCell`. + /// Access cache used by [`WorldCell`]. Is only accessed in the `Drop` impl of `WorldCell`. pub(crate) archetype_component_access: ArchetypeComponentAccess, pub(crate) change_tick: AtomicU32, pub(crate) last_change_tick: Tick, diff --git a/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs b/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs index ad8c6c1ec3..f88580e01a 100644 --- a/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs +++ b/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs @@ -45,7 +45,7 @@ impl Default for ReportHierarchyIssue { } } -/// System to print a warning for each `Entity` with a `T` component +/// System to print a warning for each [`Entity`] with a `T` component /// which parent hasn't a `T` component. /// /// Hierarchy propagations are top-down, and limited only to entities diff --git a/crates/bevy_input/src/gamepad.rs b/crates/bevy_input/src/gamepad.rs index 05dd41a02d..44af96d89b 100644 --- a/crates/bevy_input/src/gamepad.rs +++ b/crates/bevy_input/src/gamepad.rs @@ -90,7 +90,7 @@ impl Gamepad { } } -/// Metadata associated with a `Gamepad`. +/// Metadata associated with a [`Gamepad`]. #[derive(Debug, Clone, PartialEq, Eq, Reflect, FromReflect)] #[reflect(Debug, PartialEq)] #[cfg_attr( @@ -629,9 +629,9 @@ impl AxisSettings { /// /// # Errors /// - /// Returns an `AxisSettingsError` if any restrictions on the zone values are not met. - /// If the zone restrictions are met, but the ``threshold`` value restrictions are not met, - /// returns `AxisSettingsError::Threshold`. + /// Returns an [`AxisSettingsError`] if any restrictions on the zone values are not met. + /// If the zone restrictions are met, but the `threshold` value restrictions are not met, + /// returns [`AxisSettingsError::Threshold`]. pub fn new( livezone_lowerbound: f32, deadzone_lowerbound: f32, @@ -875,7 +875,7 @@ impl AxisSettings { } /// Determines whether the change from `old_value` to `new_value` should - /// be registered as a change, according to the `AxisSettings`. + /// be registered as a change, according to the [`AxisSettings`]. fn should_register_change(&self, new_value: f32, old_value: Option) -> bool { if old_value.is_none() { return true; @@ -963,7 +963,7 @@ impl ButtonAxisSettings { f32::abs(new_value - old_value.unwrap()) > self.threshold } - /// Filters the `new_value` based on the `old_value`, according to the `ButtonAxisSettings`. + /// Filters the `new_value` based on the `old_value`, according to the [`ButtonAxisSettings`]. /// /// Returns the clamped `new_value`, according to the [`ButtonAxisSettings`], if the change /// exceeds the settings threshold, and `None` otherwise. @@ -1116,7 +1116,7 @@ impl GamepadButtonChangedEvent { } } -/// Uses [`GamepadAxisChangedEvent`]s to update the relevant `Input` and `Axis` values. +/// Uses [`GamepadAxisChangedEvent`]s to update the relevant [`Input`] and [`Axis`] values. pub fn gamepad_axis_event_system( mut gamepad_axis: ResMut>, mut axis_events: EventReader, @@ -1127,7 +1127,7 @@ pub fn gamepad_axis_event_system( } } -/// Uses [`GamepadButtonChangedEvent`]s to update the relevant `Input` and `Axis` values. +/// Uses [`GamepadButtonChangedEvent`]s to update the relevant [`Input`] and [`Axis`] values. pub fn gamepad_button_event_system( mut button_events: EventReader, mut button_input: ResMut>, diff --git a/crates/bevy_ptr/src/lib.rs b/crates/bevy_ptr/src/lib.rs index 39aada6099..6a1ad7747a 100644 --- a/crates/bevy_ptr/src/lib.rs +++ b/crates/bevy_ptr/src/lib.rs @@ -148,7 +148,7 @@ impl<'a, A: IsAligned> Ptr<'a, A> { /// - If the `A` type parameter is [`Aligned`] then `inner` must be sufficiently aligned for the pointee type. /// - `inner` must have correct provenance to allow reads of the pointee type. /// - The lifetime `'a` must be constrained such that this [`Ptr`] will stay valid and nothing - /// can mutate the pointee while this [`Ptr`] is live except through an `UnsafeCell`. + /// can mutate the pointee while this [`Ptr`] is live except through an [`UnsafeCell`]. #[inline] pub unsafe fn new(inner: NonNull) -> Self { Self(inner, PhantomData) @@ -167,7 +167,7 @@ impl<'a, A: IsAligned> Ptr<'a, A> { /// /// # Safety /// - `T` must be the erased pointee type for this [`Ptr`]. - /// - If the type parameter `A` is `Unaligned` then this pointer must be sufficiently aligned + /// - If the type parameter `A` is [`Unaligned`] then this pointer must be sufficiently aligned /// for the pointee type `T`. #[inline] pub unsafe fn deref(self) -> &'a T { @@ -290,7 +290,7 @@ impl<'a, A: IsAligned> OwningPtr<'a, A> { /// /// # Safety /// - `T` must be the erased pointee type for this [`OwningPtr`]. - /// - If the type parameter `A` is `Unaligned` then this pointer must be sufficiently aligned + /// - If the type parameter `A` is [`Unaligned`] then this pointer must be sufficiently aligned /// for the pointee type `T`. #[inline] pub unsafe fn read(self) -> T { @@ -301,7 +301,7 @@ impl<'a, A: IsAligned> OwningPtr<'a, A> { /// /// # Safety /// - `T` must be the erased pointee type for this [`OwningPtr`]. - /// - If the type parameter `A` is `Unaligned` then this pointer must be sufficiently aligned + /// - If the type parameter `A` is [`Unaligned`] then this pointer must be sufficiently aligned /// for the pointee type `T`. #[inline] pub unsafe fn drop_as(self) { diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs b/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs index ff3a83a7a2..76d45f39e2 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs @@ -32,7 +32,7 @@ pub(crate) struct ResultSifter { errors: Option, } -/// Returns a `Member` made of `ident` or `index` if `ident` is None. +/// Returns a [`Member`] made of `ident` or `index` if `ident` is None. /// /// Rust struct syntax allows for `Struct { foo: "string" }` with explicitly /// named fields. It allows the `Struct { 0: "string" }` syntax when the struct diff --git a/crates/bevy_reflect/src/type_registry.rs b/crates/bevy_reflect/src/type_registry.rs index 649a43583d..aeaba79a2f 100644 --- a/crates/bevy_reflect/src/type_registry.rs +++ b/crates/bevy_reflect/src/type_registry.rs @@ -131,7 +131,7 @@ impl TypeRegistry { /// /// Most of the time [`TypeRegistry::register`] can be used instead to register a type you derived [`Reflect`] for. /// However, in cases where you want to add a piece of type data that was not included in the list of `#[reflect(...)]` type data in the derive, - /// or where the type is generic and cannot register e.g. `ReflectSerialize` unconditionally without knowing the specific type parameters, + /// or where the type is generic and cannot register e.g. [`ReflectSerialize`] unconditionally without knowing the specific type parameters, /// this method can be used to insert additional type data. /// /// # Example @@ -220,7 +220,7 @@ impl TypeRegistry { .and_then(|id| self.registrations.get_mut(id)) } - /// Returns a reference to the [`TypeData`] of type `T` associated with the given `TypeId`. + /// Returns a reference to the [`TypeData`] of type `T` associated with the given [`TypeId`]. /// /// The returned value may be used to downcast [`Reflect`] trait objects to /// trait objects of the trait used to generate `T`, provided that the @@ -234,7 +234,7 @@ impl TypeRegistry { .and_then(|registration| registration.data::()) } - /// Returns a mutable reference to the [`TypeData`] of type `T` associated with the given `TypeId`. + /// Returns a mutable reference to the [`TypeData`] of type `T` associated with the given [`TypeId`]. /// /// If the specified type has not been registered, or if `T` is not present /// in its type registration, returns `None`. @@ -243,7 +243,7 @@ impl TypeRegistry { .and_then(|registration| registration.data_mut::()) } - /// Returns the [`TypeInfo`] associated with the given `TypeId`. + /// Returns the [`TypeInfo`] associated with the given [`TypeId`]. /// /// If the specified type has not been registered, returns `None`. pub fn get_type_info(&self, type_id: TypeId) -> Option<&'static TypeInfo> { diff --git a/crates/bevy_render/macros/src/as_bind_group.rs b/crates/bevy_render/macros/src/as_bind_group.rs index acf2fed037..7b44b7e0bb 100644 --- a/crates/bevy_render/macros/src/as_bind_group.rs +++ b/crates/bevy_render/macros/src/as_bind_group.rs @@ -469,7 +469,7 @@ struct UniformBindingMeta { /// Represents the arguments for any general binding attribute. /// /// If parsed, represents an attribute -/// like `#[foo(LitInt, ...)]` where the rest is optional `NestedMeta`. +/// like `#[foo(LitInt, ...)]` where the rest is optional [`NestedMeta`]. enum BindingMeta { IndexOnly(LitInt), IndexWithOptions(BindingIndexOptions), diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 6c852239c4..ab4c8f1dce 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -79,27 +79,27 @@ pub enum RenderSet { ExtractCommands, /// Prepare render resources from the extracted data for the GPU. Prepare, - /// The copy of [`apply_system_buffers`] that runs immediately after `Prepare`. + /// The copy of [`apply_system_buffers`] that runs immediately after [`Prepare`](RenderSet::Prepare). PrepareFlush, - /// Create [`BindGroups`](crate::render_resource::BindGroup) that depend on + /// Create [`BindGroups`](render_resource::BindGroup) that depend on /// [`Prepare`](RenderSet::Prepare) data and queue up draw calls to run during the /// [`Render`](RenderSet::Render) step. Queue, - /// The copy of [`apply_system_buffers`] that runs immediately after `Queue`. + /// The copy of [`apply_system_buffers`] that runs immediately after [`Queue`](RenderSet::Queue). QueueFlush, // TODO: This could probably be moved in favor of a system ordering abstraction in Render or Queue - /// Sort the [`RenderPhases`](crate::render_phase::RenderPhase) here. + /// Sort the [`RenderPhases`](render_phase::RenderPhase) here. PhaseSort, - /// The copy of [`apply_system_buffers`] that runs immediately after `PhaseSort`. + /// The copy of [`apply_system_buffers`] that runs immediately after [`PhaseSort`](RenderSet::PhaseSort). PhaseSortFlush, /// Actual rendering happens here. /// In most cases, only the render backend should insert resources here. Render, - /// The copy of [`apply_system_buffers`] that runs immediately after `Render`. + /// The copy of [`apply_system_buffers`] that runs immediately after [`Render`](RenderSet::Render). RenderFlush, /// Cleanup render resources here. Cleanup, - /// The copy of [`apply_system_buffers`] that runs immediately after `Cleanup`. + /// The copy of [`apply_system_buffers`] that runs immediately after [`Cleanup`](RenderSet::Cleanup). CleanupFlush, } diff --git a/crates/bevy_render/src/render_graph/edge.rs b/crates/bevy_render/src/render_graph/edge.rs index 88bfe24f9c..4ba85fca57 100644 --- a/crates/bevy_render/src/render_graph/edge.rs +++ b/crates/bevy_render/src/render_graph/edge.rs @@ -6,13 +6,16 @@ use super::NodeId; /// They are used to describe the ordering (which node has to run first) /// and may be of two kinds: [`NodeEdge`](Self::NodeEdge) and [`SlotEdge`](Self::SlotEdge). /// -/// Edges are added via the `render_graph::add_node_edge(output_node, input_node)` and the -/// `render_graph::add_slot_edge(output_node, output_slot, input_node, input_slot)` methods. +/// Edges are added via the [`RenderGraph::add_node_edge`] and the +/// [`RenderGraph::add_slot_edge`] methods. /// /// The former simply states that the `output_node` has to be run before the `input_node`, /// while the later connects an output slot of the `output_node` /// with an input slot of the `input_node` to pass additional data along. /// For more information see [`SlotType`](super::SlotType). +/// +/// [`RenderGraph::add_node_edge`]: crate::render_graph::RenderGraph::add_node_edge +/// [`RenderGraph::add_slot_edge`]: crate::render_graph::RenderGraph::add_slot_edge #[derive(Clone, Debug, Eq, PartialEq)] pub enum Edge { /// An edge describing to ordering of both nodes (`output_node` before `input_node`) diff --git a/crates/bevy_render/src/render_phase/draw.rs b/crates/bevy_render/src/render_phase/draw.rs index 9b370f2e38..405467ebec 100644 --- a/crates/bevy_render/src/render_phase/draw.rs +++ b/crates/bevy_render/src/render_phase/draw.rs @@ -18,7 +18,7 @@ use std::{any::TypeId, fmt::Debug, hash::Hash}; /// [`RenderCommand`]s. For more details and an example see the [`RenderCommand`] documentation. pub trait Draw: Send + Sync + 'static { /// Prepares the draw function to be used. This is called once and only once before the phase - /// begins. There may be zero or more `draw` calls following a call to this function. + /// begins. There may be zero or more [`draw`](Draw::draw) calls following a call to this function. /// Implementing this is optional. #[allow(unused_variables)] fn prepare(&mut self, world: &'_ World) {} @@ -249,7 +249,7 @@ where C::Param: ReadOnlySystemParam, { /// Prepares the render command to be used. This is called once and only once before the phase - /// begins. There may be zero or more `draw` calls following a call to this function. + /// begins. There may be zero or more [`draw`](RenderCommandState::draw) calls following a call to this function. fn prepare(&mut self, world: &'_ World) { self.state.update_archetypes(world); self.view.update_archetypes(world); diff --git a/crates/bevy_render/src/renderer/mod.rs b/crates/bevy_render/src/renderer/mod.rs index a0fb731a6e..6a9d9be6e1 100644 --- a/crates/bevy_render/src/renderer/mod.rs +++ b/crates/bevy_render/src/renderer/mod.rs @@ -107,7 +107,7 @@ pub struct RenderAdapter(pub Arc); #[derive(Resource, Deref, DerefMut)] pub struct RenderInstance(pub Instance); -/// The `AdapterInfo` of the adapter in use by the renderer. +/// The [`AdapterInfo`] of the adapter in use by the renderer. #[derive(Resource, Clone, Deref, DerefMut)] pub struct RenderAdapterInfo(pub AdapterInfo); diff --git a/crates/bevy_render/src/texture/image.rs b/crates/bevy_render/src/texture/image.rs index 9df28d4210..065d35424e 100644 --- a/crates/bevy_render/src/texture/image.rs +++ b/crates/bevy_render/src/texture/image.rs @@ -128,19 +128,19 @@ pub enum ImageSampler { } impl ImageSampler { - /// Returns an image sampler with `Linear` min and mag filters + /// Returns an image sampler with [`Linear`](crate::render_resource::FilterMode::Linear) min and mag filters #[inline] pub fn linear() -> ImageSampler { ImageSampler::Descriptor(Self::linear_descriptor()) } - /// Returns an image sampler with `nearest` min and mag filters + /// Returns an image sampler with [`Nearest`](crate::render_resource::FilterMode::Nearest) min and mag filters #[inline] pub fn nearest() -> ImageSampler { ImageSampler::Descriptor(Self::nearest_descriptor()) } - /// Returns a sampler descriptor with `Linear` min and mag filters + /// Returns a sampler descriptor with [`Linear`](crate::render_resource::FilterMode::Linear) min and mag filters #[inline] pub fn linear_descriptor() -> wgpu::SamplerDescriptor<'static> { wgpu::SamplerDescriptor { @@ -151,7 +151,7 @@ impl ImageSampler { } } - /// Returns a sampler descriptor with `Nearest` min and mag filters + /// Returns a sampler descriptor with [`Nearest`](crate::render_resource::FilterMode::Nearest) min and mag filters #[inline] pub fn nearest_descriptor() -> wgpu::SamplerDescriptor<'static> { wgpu::SamplerDescriptor { diff --git a/crates/bevy_render/src/view/visibility/mod.rs b/crates/bevy_render/src/view/visibility/mod.rs index 25f0fc02fa..9521c1567e 100644 --- a/crates/bevy_render/src/view/visibility/mod.rs +++ b/crates/bevy_render/src/view/visibility/mod.rs @@ -25,7 +25,7 @@ use crate::{ /// User indication of whether an entity is visible. Propagates down the entity hierarchy. /// /// If an entity is hidden in this way, all [`Children`] (and all of their children and so on) who -/// are set to `Inherited` will also be hidden. +/// are set to [`Inherited`](Self::Inherited) will also be hidden. /// /// This is done by the `visibility_propagate_system` which uses the entity hierarchy and /// `Visibility` to set the values of each entity's [`ComputedVisibility`] component. diff --git a/crates/bevy_scene/src/dynamic_scene.rs b/crates/bevy_scene/src/dynamic_scene.rs index 23a033c969..0a45e0e82b 100644 --- a/crates/bevy_scene/src/dynamic_scene.rs +++ b/crates/bevy_scene/src/dynamic_scene.rs @@ -36,10 +36,10 @@ pub struct DynamicScene { /// A reflection-powered serializable representation of an entity and its components. pub struct DynamicEntity { - /// The transiently unique identifier of a corresponding `Entity`. + /// The transiently unique identifier of a corresponding [`Entity`](bevy_ecs::entity::Entity). pub entity: u32, /// A vector of boxed components that belong to the given entity and - /// implement the `Reflect` trait. + /// implement the [`Reflect`] trait. pub components: Vec>, } diff --git a/crates/bevy_sprite/src/collide_aabb.rs b/crates/bevy_sprite/src/collide_aabb.rs index f455c9fe4a..77fe3c1a2b 100644 --- a/crates/bevy_sprite/src/collide_aabb.rs +++ b/crates/bevy_sprite/src/collide_aabb.rs @@ -14,13 +14,13 @@ pub enum Collision { // TODO: ideally we can remove this once bevy gets a physics system /// Axis-aligned bounding box collision with "side" detection /// * `a_pos` and `b_pos` are the center positions of the rectangles, typically obtained by -/// extracting the `translation` field from a `Transform` component +/// extracting the `translation` field from a [`Transform`](bevy_transform::components::Transform) component /// * `a_size` and `b_size` are the dimensions (width and height) of the rectangles. /// -/// The return value is the side of `B` that `A` has collided with. `Left` means that -/// `A` collided with `B`'s left side. `Top` means that `A` collided with `B`'s top side. +/// The return value is the side of `B` that `A` has collided with. [`Collision::Left`] means that +/// `A` collided with `B`'s left side. [`Collision::Top`] means that `A` collided with `B`'s top side. /// If the collision occurs on multiple sides, the side with the deepest penetration is returned. -/// If all sides are involved, `Inside` is returned. +/// If all sides are involved, [`Collision::Inside`] is returned. pub fn collide(a_pos: Vec3, a_size: Vec2, b_pos: Vec3, b_size: Vec2) -> Option { let a_min = a_pos.truncate() - a_size / 2.0; let a_max = a_pos.truncate() + a_size / 2.0; diff --git a/crates/bevy_sprite/src/render/mod.rs b/crates/bevy_sprite/src/render/mod.rs index 29f24bf37c..1279de05f0 100644 --- a/crates/bevy_sprite/src/render/mod.rs +++ b/crates/bevy_sprite/src/render/mod.rs @@ -309,7 +309,7 @@ pub struct ExtractedSprite { pub rect: Option, /// Change the on-screen size of the sprite pub custom_size: Option, - /// Handle to the `Image` of this sprite + /// Handle to the [`Image`] of this sprite /// PERF: storing a `HandleId` instead of `Handle` enables some optimizations (`ExtractedSprite` becomes `Copy` and doesn't need to be dropped) pub image_handle_id: HandleId, pub flip_x: bool, diff --git a/crates/bevy_tasks/src/task_pool.rs b/crates/bevy_tasks/src/task_pool.rs index 4bd1dd525d..5903e67ea1 100644 --- a/crates/bevy_tasks/src/task_pool.rs +++ b/crates/bevy_tasks/src/task_pool.rs @@ -572,7 +572,7 @@ impl Drop for TaskPool { } } -/// A `TaskPool` scope for running one or more non-`'static` futures. +/// A [`TaskPool`] scope for running one or more non-`'static` futures. /// /// For more information, see [`TaskPool::scope`]. #[derive(Debug)] diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs index fdabddab07..a17a1c6709 100644 --- a/crates/bevy_text/src/text2d.rs +++ b/crates/bevy_text/src/text2d.rs @@ -29,7 +29,7 @@ use crate::{ /// The maximum width and height of text. The text will wrap according to the specified size. /// Characters out of the bounds after wrapping will be truncated. Text is aligned according to the -/// specified `TextAlignment`. +/// specified [`TextAlignment`](crate::text::TextAlignment). /// /// Note: only characters that are completely out of the bounds will be truncated, so this is not a /// reliable limit if it is necessary to contain the text strictly in the bounds. Currently this diff --git a/crates/bevy_transform/src/commands.rs b/crates/bevy_transform/src/commands.rs index dc2a950b41..7a5a7b2c02 100644 --- a/crates/bevy_transform/src/commands.rs +++ b/crates/bevy_transform/src/commands.rs @@ -45,7 +45,7 @@ impl Command for AddChildInPlace { /// You most likely want to use [`BuildChildrenTransformExt::remove_parent_in_place`] /// method on [`EntityCommands`] instead. pub struct RemoveParentInPlace { - /// `Entity` whose parent must be removed. + /// [`Entity`] whose parent must be removed. pub child: Entity, } impl Command for RemoveParentInPlace { diff --git a/crates/bevy_transform/src/components/global_transform.rs b/crates/bevy_transform/src/components/global_transform.rs index d82d7bdddc..a4379419b3 100644 --- a/crates/bevy_transform/src/components/global_transform.rs +++ b/crates/bevy_transform/src/components/global_transform.rs @@ -111,9 +111,9 @@ impl GlobalTransform { /// Returns the [`Transform`] `self` would have if it was a child of an entity /// with the `parent` [`GlobalTransform`]. /// - /// This is useful if you want to "reparent" an `Entity`. Say you have an entity - /// `e1` that you want to turn into a child of `e2`, but you want `e1` to keep the - /// same global transform, even after re-parenting. You would use: + /// This is useful if you want to "reparent" an [`Entity`](bevy_ecs::entity::Entity). + /// Say you have an entity `e1` that you want to turn into a child of `e2`, + /// but you want `e1` to keep the same global transform, even after re-parenting. You would use: /// /// ```rust /// # use bevy_transform::prelude::{GlobalTransform, Transform}; diff --git a/crates/bevy_ui/src/camera_config.rs b/crates/bevy_ui/src/camera_config.rs index 097437ac73..7be35d3fd7 100644 --- a/crates/bevy_ui/src/camera_config.rs +++ b/crates/bevy_ui/src/camera_config.rs @@ -15,7 +15,7 @@ use bevy_render::extract_component::ExtractComponent; pub struct UiCameraConfig { /// Whether to output UI to this camera view. /// - /// When a `Camera` doesn't have the [`UiCameraConfig`] component, + /// When a [`Camera`] doesn't have the [`UiCameraConfig`] component, /// it will display the UI by default. pub show_ui: bool, } diff --git a/crates/bevy_ui/src/node_bundles.rs b/crates/bevy_ui/src/node_bundles.rs index 3b068e557b..f2cd55c77a 100644 --- a/crates/bevy_ui/src/node_bundles.rs +++ b/crates/bevy_ui/src/node_bundles.rs @@ -30,7 +30,7 @@ pub struct NodeBundle { /// The transform of the node /// /// This field is automatically managed by the UI layout system. - /// To alter the position of the `nodebundle`, use the properties of the [`Style`] component. + /// To alter the position of the `NodeBundle`, use the properties of the [`Style`] component. pub transform: Transform, /// The global transform of the node /// diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index f2093ba14f..494a7f3460 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -29,13 +29,13 @@ impl Node { self.calculated_size } - /// Returns the logical pixel coordinates of the UI node, based on its `GlobalTransform`. + /// Returns the logical pixel coordinates of the UI node, based on its [`GlobalTransform`]. #[inline] pub fn logical_rect(&self, transform: &GlobalTransform) -> Rect { Rect::from_center_size(transform.translation().truncate(), self.size()) } - /// Returns the physical pixel coordinates of the UI node, based on its `GlobalTransform` and the scale factor. + /// Returns the physical pixel coordinates of the UI node, based on its [`GlobalTransform`] and the scale factor. #[inline] pub fn physical_rect(&self, transform: &GlobalTransform, scale_factor: f32) -> Rect { let rect = self.logical_rect(transform); diff --git a/crates/bevy_window/src/event.rs b/crates/bevy_window/src/event.rs index fbaa843928..0f240edbd5 100644 --- a/crates/bevy_window/src/event.rs +++ b/crates/bevy_window/src/event.rs @@ -74,7 +74,7 @@ pub struct WindowCloseRequested { } /// An event that is sent whenever a window is closed. This will be sent when -/// the window entity loses its `Window` component or is despawned. +/// the window entity loses its [`Window`](crate::window::Window) component or is despawned. #[derive(Debug, Clone, PartialEq, Eq, Reflect, FromReflect)] #[reflect(Debug, PartialEq)] #[cfg_attr( diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs index 5b079d5137..ada0387a4d 100644 --- a/crates/bevy_window/src/window.rs +++ b/crates/bevy_window/src/window.rs @@ -694,16 +694,23 @@ pub enum MonitorSelection { /// Presentation mode for a window. /// -/// The presentation mode specifies when a frame is presented to the window. The `Fifo` +/// The presentation mode specifies when a frame is presented to the window. The [`Fifo`] /// option corresponds to a traditional `VSync`, where the framerate is capped by the -/// display refresh rate. Both `Immediate` and `Mailbox` are low-latency and are not +/// display refresh rate. Both [`Immediate`] and [`Mailbox`] are low-latency and are not /// capped by the refresh rate, but may not be available on all platforms. Tearing -/// may be observed with `Immediate` mode, but will not be observed with `Mailbox` or -/// `Fifo`. +/// may be observed with [`Immediate`] mode, but will not be observed with [`Mailbox`] or +/// [`Fifo`]. /// -/// `AutoVsync` or `AutoNoVsync` will gracefully fallback to `Fifo` when unavailable. +/// [`AutoVsync`] or [`AutoNoVsync`] will gracefully fallback to [`Fifo`] when unavailable. +/// +/// [`Immediate`] or [`Mailbox`] will panic if not supported by the platform. +/// +/// [`Fifo`]: PresentMode::Fifo +/// [`Immediate`]: PresentMode::Immediate +/// [`Mailbox`]: PresentMode::Mailbox +/// [`AutoVsync`]: PresentMode::AutoVsync +/// [`AutoNoVsync`]: PresentMode::AutoNoVsync /// -/// `Immediate` or `Mailbox` will panic if not supported by the platform. #[repr(C)] #[derive(Default, Copy, Clone, Debug, PartialEq, Eq, Hash, Reflect, FromReflect)] #[cfg_attr( @@ -753,8 +760,8 @@ pub enum PresentMode { )] #[reflect(Debug, PartialEq, Hash)] pub enum CompositeAlphaMode { - /// Chooses either `Opaque` or `Inherit` automatically, depending on the - /// `alpha_mode` that the current surface can support. + /// Chooses either [`Opaque`](CompositeAlphaMode::Opaque) or [`Inherit`](CompositeAlphaMode::Inherit) + /// automatically, depending on the `alpha_mode` that the current surface can support. #[default] Auto = 0, /// The alpha channel, if it exists, of the textures is ignored in the diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index f122f4899d..522737e227 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -264,7 +264,8 @@ struct WinitPersistentState { low_power_event: bool, /// Tracks whether the event loop was started this frame because of a redraw request. redraw_request_sent: bool, - /// Tracks if the event loop was started this frame because of a `WaitUntil` timeout. + /// Tracks if the event loop was started this frame because of a [`ControlFlow::WaitUntil`] + /// timeout. timeout_reached: bool, last_update: Instant, } diff --git a/crates/bevy_winit/src/system.rs b/crates/bevy_winit/src/system.rs index 592251cbcf..996ddf1b67 100644 --- a/crates/bevy_winit/src/system.rs +++ b/crates/bevy_winit/src/system.rs @@ -27,7 +27,7 @@ use crate::{ get_best_videomode, get_fitting_videomode, WinitWindows, }; -/// System responsible for creating new windows whenever a `Window` component is added +/// System responsible for creating new windows whenever a [`Window`] component is added /// to an entity. /// /// This will default any necessary components if they are not already added. diff --git a/crates/bevy_winit/src/winit_config.rs b/crates/bevy_winit/src/winit_config.rs index d5627c4b22..ec2ff83127 100644 --- a/crates/bevy_winit/src/winit_config.rs +++ b/crates/bevy_winit/src/winit_config.rs @@ -51,7 +51,7 @@ impl WinitSettings { } } - /// Gets the configured `UpdateMode` depending on whether the window is focused or not + /// Gets the configured [`UpdateMode`] depending on whether the window is focused or not pub fn update_mode(&self, focused: bool) -> &UpdateMode { match focused { true => &self.focused_mode, diff --git a/examples/3d/transparency_3d.rs b/examples/3d/transparency_3d.rs index 7ccf1df8ab..f048f95942 100644 --- a/examples/3d/transparency_3d.rs +++ b/examples/3d/transparency_3d.rs @@ -107,10 +107,10 @@ fn setup( /// Fades the alpha channel of all materials between 0 and 1 over time. /// Each blend mode responds differently to this: -/// - `Opaque`: Ignores alpha channel altogether, these materials stay completely opaque. -/// - `Mask(f32)`: Object appears when the alpha value goes above the mask's threshold, disappears +/// - [`Opaque`](AlphaMode::Opaque): Ignores alpha channel altogether, these materials stay completely opaque. +/// - [`Mask(f32)`](AlphaMode::Mask): Object appears when the alpha value goes above the mask's threshold, disappears /// when the alpha value goes back below the threshold. -/// - `Blend`: Object fades in and out smoothly. +/// - [`Blend`](AlphaMode::Blend): Object fades in and out smoothly. pub fn fade_transparency(time: Res