aboutsummaryrefslogtreecommitdiff
path: root/mingling_core
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-14 04:00:06 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-14 04:00:06 +0800
commit719b92782bd87659c62bea92365ad211a5f4569f (patch)
tree183c539d8d3643e051787a1c55edd4f63dae4560 /mingling_core
parent5aeea111091efbc80d6796c067b586a48930f48e (diff)
chore: add doc comment for MockProgramCollect
Diffstat (limited to 'mingling_core')
-rw-r--r--mingling_core/src/program/collection/mock.rs29
1 files changed, 24 insertions, 5 deletions
diff --git a/mingling_core/src/program/collection/mock.rs b/mingling_core/src/program/collection/mock.rs
index b8d881e..634d529 100644
--- a/mingling_core/src/program/collection/mock.rs
+++ b/mingling_core/src/program/collection/mock.rs
@@ -1,21 +1,40 @@
-// Doc Not Optimize
+use crate::{AnyOutput, ChainProcess, Grouped, ProgramCollect, RenderResult};
+
#[cfg(feature = "async")]
use std::pin::Pin;
#[cfg(feature = "dispatch_tree")]
use crate::Dispatcher;
-use crate::{AnyOutput, ChainProcess, Grouped, ProgramCollect, RenderResult};
+#[cfg(feature = "comp")]
+use crate::{ShellContext, Suggest};
#[cfg(feature = "structural_renderer")]
use crate::{StructuralRendererSetting, error::StructuralRendererSerializeError};
-#[cfg(feature = "comp")]
-use crate::{ShellContext, Suggest};
-
#[cfg(feature = "structural_renderer")]
use serde::Serialize;
+/// Used to simulate the types generated by the `gen_program!` macro in examples and tests.
+///
+/// It can be referenced in documentation using the following code:
+///
+/// ```rust,ignore
+/// use mingling_core::MockProgramCollect as ThisProgram;
+/// ```
+///
+/// This enum is for development and testing purposes only and should not be used in production code.
+/// It simulates the program enum type generated by the `gen_program!` macro, allowing examples, unit tests, and doctests to work without actual macro expansion.
+///
+/// # Variants
+///
+/// - `Foo` — Simulates the first program node ID of the program.
+/// - `Bar` — Simulates the second program node ID of the program.
+///
+/// # Safety Notes
+///
+/// This type implements the `ProgramCollect` trait, but all actual methods are implemented via `unreachable!()` or `panic!`,
+/// ensuring it will never be called in a real macro system. It is only used to satisfy trait bounds so that type checking passes at compile time.
#[cfg_attr(feature = "structural_renderer", derive(Serialize))]
#[allow(unused)]
#[doc(hidden)]