aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-14 00:30:31 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-14 00:30:31 +0800
commit299b96c8917a7b2c70c9e8040c064d3186ecd760 (patch)
treeaa79d713981f54bf0635e9d0db5c25750fabee23 /mingling_core/src
parent0b236d0c73da51ccde3cfe442db8c47ce521d262 (diff)
chore(docs): fix intra-doc link formatting
Replace intra-doc links with explicit URLs for types that are not accessible from the current module scope, and add missing panic documentation section.
Diffstat (limited to 'mingling_core/src')
-rw-r--r--mingling_core/src/any.rs14
-rw-r--r--mingling_core/src/asset/global_resource.rs2
-rw-r--r--mingling_core/src/asset/help.rs4
-rw-r--r--mingling_core/src/asset/routable.rs2
-rw-r--r--mingling_core/src/lib.rs2
5 files changed, 14 insertions, 10 deletions
diff --git a/mingling_core/src/any.rs b/mingling_core/src/any.rs
index 34f373d..b1f49e7 100644
--- a/mingling_core/src/any.rs
+++ b/mingling_core/src/any.rs
@@ -19,7 +19,7 @@ pub use group::*;
pub struct AnyOutput<G> {
pub(crate) inner: Box<dyn std::any::Any + Send + 'static>,
- /// The [`TypeId`] of the concrete type stored in `inner`.
+ /// The [`TypeId`](std::any::TypeId) of the concrete type stored in `inner`.
///
/// This is set during construction and used for type-checking
/// in downcast, restore, and is methods.
@@ -35,6 +35,10 @@ pub struct AnyOutput<G> {
impl<G> AnyOutput<G> {
/// Create an `AnyOutput` from a `Send + Grouped<G>` type
+ ///
+ /// # Panics
+ ///
+ /// This function does not panic.
pub fn new<T>(value: T) -> Self
where
T: Send + Grouped<G> + 'static,
@@ -46,7 +50,7 @@ impl<G> AnyOutput<G> {
}
}
- /// Create an `AnyOutput` from a raw value with a manually specified [`member_id`].
+ /// Create an `AnyOutput` from a raw value with a manually specified `member_id`.
///
/// This function bypasses the [`Grouped`] trait, meaning the `member_id` you provide
/// does **not** have to match the actual concrete type `T`. The scheduler uses
@@ -72,9 +76,9 @@ impl<G> AnyOutput<G> {
}
}
- /// Get the [`TypeId`] of the concrete type stored in `inner`.
+ /// Get the [`TypeId`](std::any::TypeId) of the concrete type stored in `inner`.
///
- /// The `TypeId` is set during construction (via [`AnyOutput::new`] or [`AnyOutput::new_bare`])
+ /// The [`TypeId`](std::any::TypeId) is set during construction (via [`AnyOutput::new`] or [`AnyOutput::new_bare`])
/// and is used for subsequent downcasting and type checking.
pub const fn type_id(&self) -> std::any::TypeId {
self.type_id
@@ -128,7 +132,7 @@ impl<G> AnyOutput<G> {
///
/// # Safety
///
- /// This is only safe when `T` matches the `TypeId` stored in the `AnyOutput`.
+ /// This is only safe when `T` matches the [`TypeId`](std::any::TypeId) stored in the `AnyOutput`.
/// Generated code (via `gen_program!()`) guarantees this by dispatching on
/// `member_id` before calling `restore`.
pub fn restore<T: 'static>(self) -> Option<T> {
diff --git a/mingling_core/src/asset/global_resource.rs b/mingling_core/src/asset/global_resource.rs
index 06731f7..27ccfe4 100644
--- a/mingling_core/src/asset/global_resource.rs
+++ b/mingling_core/src/asset/global_resource.rs
@@ -1158,7 +1158,7 @@ where
///
/// # Usage
///
-/// `GlobalResource<ResType>` implements [`Deref`] (with target type `ResType`), so it can be
+/// `GlobalResource<ResType>` implements [`Deref`](https://doc.rust-lang.org/stable/core/ops/trait.Deref.html) (with target type `ResType`), so it can be
/// dereferenced directly like `&ResType` to access the underlying value:
///
/// ```
diff --git a/mingling_core/src/asset/help.rs b/mingling_core/src/asset/help.rs
index 78da1d1..4c20928 100644
--- a/mingling_core/src/asset/help.rs
+++ b/mingling_core/src/asset/help.rs
@@ -2,8 +2,8 @@ use crate::RenderResult;
/// Mingling's program help request.
///
-/// It provides help capability to a program by binding an entry type. When [`Program`]'s `user_context.help` is `true`,
-/// the first Entry produced by [`Dispatcher`] will be sent into [`HelpRequest`] and rendered into a [`RenderResult`] for the user.
+/// It provides help capability to a program by binding an entry type. When [`Program`](https://docs.rs/mingling/latest/mingling/struct.Program.html)'s `user_context.help` is `true`,
+/// the first Entry produced by [`Dispatcher`](https://docs.rs/mingling/latest/mingling/trait.Dispatcher.html) will be sent into [`HelpRequest`] and rendered into a [`RenderResult`] for the user.
///
/// # Manual impl
///
diff --git a/mingling_core/src/asset/routable.rs b/mingling_core/src/asset/routable.rs
index 7ed0fb4..7381b48 100644
--- a/mingling_core/src/asset/routable.rs
+++ b/mingling_core/src/asset/routable.rs
@@ -3,7 +3,7 @@ use crate::{AnyOutput, ChainProcess, Grouped, ProgramCollect};
/// Represents a type that can be routed within a group.
///
/// Used to indicate that a group member can be routed into another [`ChainProcess`]
-/// within the execution logic of a [`Chain`].
+/// within the execution logic of a [`Chain`](https://docs.rs/mingling/latest/mingling/trait.Chain.html).
///
/// # Blanket impl
///
diff --git a/mingling_core/src/lib.rs b/mingling_core/src/lib.rs
index 0688c94..572520e 100644
--- a/mingling_core/src/lib.rs
+++ b/mingling_core/src/lib.rs
@@ -24,7 +24,7 @@ mod tester;
/// Module for setting up a `Mingling` program.
///
-/// This module provides the [`ProgramSetup`] type, which allows users to configure
+/// This module provides the [`ProgramSetup`](https://docs.rs/mingling/latest/mingling/setup/trait.ProgramSetup.html) type, which allows users to configure
/// and initialize the program's execution environment.
pub mod setup {
pub use crate::program::setup::ProgramSetup;