diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-04 13:28:34 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-04 13:30:42 +0800 |
| commit | b8ccbf380a1253a20303c35a5f3343c4d52e31f5 (patch) | |
| tree | c28f4fb9c7c0b3a09e9d9709ba8f07e09356a9ca /mingling/src | |
| parent | 4588e17f7ddacd8391a5c881a209735e08d48797 (diff) | |
feat(gen_program): add get_metadata method stub
Diffstat (limited to 'mingling/src')
| -rw-r--r-- | mingling/src/example_docs.rs | 6 | ||||
| -rw-r--r-- | mingling/src/gen_program.rs | 5 |
2 files changed, 11 insertions, 0 deletions
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::<Description>(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::<Description>(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<T: 'static>(member_id: Self::Enum) -> Option<T> { + let _ = member_id; + todo!() + } + #[cfg(feature = "async")] fn do_chain( _any: mingling_core::AnyOutput<Self::Enum>, |
