aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/lib.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-03 13:36:13 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-03 13:36:13 +0800
commit9c8f5c8d60f3066fec8a1573aa3f5673e0b2ecb8 (patch)
tree99a5de6f698310215163ffd488de2354c4b7fb3e /mingling_macros/src/lib.rs
parent82372181d3b819ce57b04207f42406c188e42ac9 (diff)
chore!: rename ErrorDispatcherNotFound to EntryFallback
Rename the internal fallback type and its associated `ProgramCollect` plumbing from `ErrorDispatcherNotFound`/`build_dispatcher_not_found` to `EntryFallback`/`build_entry_fallback`, along with the generated enum variant and pack type. Update all documentation, examples, and tests accordingly.
Diffstat (limited to 'mingling_macros/src/lib.rs')
-rw-r--r--mingling_macros/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs
index b6656da..c955e36 100644
--- a/mingling_macros/src/lib.rs
+++ b/mingling_macros/src/lib.rs
@@ -36,7 +36,7 @@
//! │ V │
//! │ Reads all registries → generates ThisProgram with: │
//! │ • ProgramCollect impl (dispatch/render/chain dispatch tree) │
-//! │ • Fallback types (ErrorDispatcherNotFound, etc.) │
+//! │ • Fallback types (EntryFallback, etc.) │
//! │ • Completion logic (if `comp` feature enabled) │
//! └──────────────────────────────────────────────────────────────────┘
//! ```
@@ -120,8 +120,8 @@
//! ```rust,ignore
//! // Example of what gen_program! generates (simplified):
//! impl ProgramCollect for ThisProgram {
-//! fn build_dispatcher_not_found(args: Vec<String>) -> AnyOutput {
-//! AnyOutput::new(ErrorDispatcherNotFound::new(args))
+//! fn build_entry_fallback(args: Vec<String>) -> AnyOutput {
+//! AnyOutput::new(EntryFallback::new(args))
//! }
//! fn has_chain(any: &AnyOutput) -> bool {
//! match any.member_id() {
@@ -978,11 +978,11 @@ pub fn chain(attr: TokenStream, item: TokenStream) -> TokenStream {
/// The macros `gen_program!` automatically generates two fallback types that
/// you can provide renderers for:
/// - `ErrorRendererNotFound` — triggered when no matching renderer is found
-/// - `ErrorDispatcherNotFound` — triggered when no matching dispatcher is found
+/// - `EntryFallback` — triggered when no matching dispatcher is found
///
/// ```rust,ignore
/// #[renderer]
-/// fn fallback_dispatcher_not_found(prev: ErrorDispatcherNotFound) -> RenderResult {
+/// fn fallback_dispatcher_not_found(prev: EntryFallback) -> RenderResult {
/// let mut result = RenderResult::new();
/// writeln!(result, "Unknown command: {}", prev.join(", "));
/// result
@@ -1819,7 +1819,7 @@ pub fn derive_grouped_serialize(input: TokenStream) -> TokenStream {
/// 1. **`pub type Next = ChainProcess<ProgramName>`** — A convenience type alias
/// for use in chain function return types.
/// 2. **`program_comp_gen!(...)`** (with `comp` feature) — Generates completion infrastructure.
-/// 3. **`program_fallback_gen!(...)`** — Generates `ErrorRendererNotFound` and `ErrorDispatcherNotFound` types.
+/// 3. **`program_fallback_gen!(...)`** — Generates `ErrorRendererNotFound` and `EntryFallback` types.
/// 4. **`program_final_gen!(...)`** — Generates the program enum with:
/// - An enum with all packed types as variants
/// - `Display` implementation for the enum