From b8ccbf380a1253a20303c35a5f3343c4d52e31f5 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 4 Aug 2026 13:28:34 +0800 Subject: feat(gen_program): add get_metadata method stub --- mingling/src/example_docs.rs | 6 ++++++ mingling/src/gen_program.rs | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'mingling/src') diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs index e3b9db6..e61551b 100644 --- a/mingling/src/example_docs.rs +++ b/mingling/src/example_docs.rs @@ -2064,6 +2064,7 @@ pub mod example_lazy_resources {} /// pub desc: String, /// } /// +/// // --------- IMPORTANT --------- /// /// Attach a `Description` to `EntryGreet`. /// /// /// /// - `BindType` = `EntryGreet` (the enum variant / entry type) @@ -2074,6 +2075,7 @@ pub mod example_lazy_resources {} /// desc: "ok".to_string(), /// } /// } +/// // --------- IMPORTANT --------- /// /// pack!(ResultName = String); /// pack!(DescResult = String); @@ -2094,10 +2096,12 @@ pub mod example_lazy_resources {} /// #[chain] /// fn handle_desc(_args: EntryDescription) -> Next { /// use mingling::ProgramCollect; +/// // --------- IMPORTANT --------- /// let msg = match ThisProgram::get_metadata::(ThisProgram::EntryGreet) { /// Some(d) => format!("EntryGreet desc = {}", d.desc), /// None => "EntryGreet has no description".to_string(), /// }; +/// // --------- IMPORTANT --------- /// DescResult::new(msg).to_render() /// } /// @@ -2105,10 +2109,12 @@ pub mod example_lazy_resources {} /// #[chain] /// fn handle_nodoc(_args: EntryNoDescription) -> Next { /// use mingling::ProgramCollect; +/// // --------- IMPORTANT --------- /// let msg = match ThisProgram::get_metadata::(ThisProgram::EntryDescription) { /// Some(d) => format!("EntryDescription desc = {}", d.desc), /// None => "EntryDescription has no description".to_string(), /// }; +/// // --------- IMPORTANT --------- /// DescResult::new(msg).to_render() /// } /// diff --git a/mingling/src/gen_program.rs b/mingling/src/gen_program.rs index a3b7e29..ef32074 100644 --- a/mingling/src/gen_program.rs +++ b/mingling/src/gen_program.rs @@ -212,6 +212,11 @@ impl ProgramCollect for ThisProgram { todo!() } + fn get_metadata(member_id: Self::Enum) -> Option { + let _ = member_id; + todo!() + } + #[cfg(feature = "async")] fn do_chain( _any: mingling_core::AnyOutput, -- cgit