From 4588e17f7ddacd8391a5c881a209735e08d48797 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 4 Aug 2026 13:26:48 +0800 Subject: feat: add entry metadata system with compile-time typed values Add `Metadata` trait and `#[metadata(Entry)]` attribute macro to attach arbitrary, compile-time-typed metadata to entries. Implement `ProgramCollect::get_metadata()` for runtime retrieval, backed by a global registry populated by `register_metadata!`. Extend `pathf` with `MetadataPattern` to resolve metadata types across modules at build time. Add two examples demonstrating metadata usage with and without pathf integration. --- examples/example-combine-pathf-metadata/Cargo.toml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/example-combine-pathf-metadata/Cargo.toml (limited to 'examples/example-combine-pathf-metadata/Cargo.toml') diff --git a/examples/example-combine-pathf-metadata/Cargo.toml b/examples/example-combine-pathf-metadata/Cargo.toml new file mode 100644 index 0000000..fd14c74 --- /dev/null +++ b/examples/example-combine-pathf-metadata/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "example-combine-pathf-metadata" +version = "0.1.0" +edition = "2024" + +[dependencies.mingling] +path = "../../mingling" +features = [ + # `extras` is required by the implicit `dispatcher!("hello")` form + "extras", + # `pathf` resolves types across modules at build time + "pathf", +] + +[build-dependencies.mingling] +path = "../../mingling" +features = [ + # Enable the `build` feature for build-time support + "build", + # `pathf` must also be enabled in build-dependencies + "pathf", +] + +[workspace] -- cgit