aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/any.rs
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/any.rs
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/any.rs')
-rw-r--r--mingling_core/src/any.rs14
1 files changed, 9 insertions, 5 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> {