aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md17
-rw-r--r--mingling_macros/src/lib.rs6
2 files changed, 23 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d2e761..23ceef5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelogs
+### Release 0.1.8
+
+#### Fixes:
+None
+
+#### Optimizings:
+None
+
+#### Features:
+
+1. **\[macros\]** The `gen_program!()` macro now generates `pub fn this() -> &'static Program<#name>` for the generated program type, providing convenient static accessors.
+
+#### **BREAKING CHANGES**:
+None
+
+---
+
### Release 0.1.7
#### Fixes:
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs
index 818cda6..6d38889 100644
--- a/mingling_macros/src/lib.rs
+++ b/mingling_macros/src/lib.rs
@@ -1220,9 +1220,15 @@ pub fn program_final_gen(input: TokenStream) -> TokenStream {
}
impl #name {
+ /// Creates a new `Program<#name>` instance with default configuration.
pub fn new() -> ::mingling::Program<#name> {
::mingling::Program::new()
}
+
+ /// Returns a static reference to the global `Program<#name>` singleton.
+ pub fn this() -> &'static ::mingling::Program<#name> {
+ &::mingling::this::<#name>()
+ }
}
};