diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-20 08:42:16 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-20 08:42:16 +0800 |
| commit | 7b3a1d7fd9f60b91a7f9602374c081882d46facc (patch) | |
| tree | dc0c8a9bf095308e6d29091db4b5037c29ed5742 /mingling_macros/src/extensions.rs | |
| parent | 9dc737acec1eab40ef65bef8e6c729a4e5e06401 (diff) | |
feat(macros): add `#[buffer]` attribute and re-export `r_print!(ln)`
macros
Reintroduce `r_print!` and `r_println!` macros as public exports, now
supporting both explicit buffer argument and implicit `#[buffer]` attr.
Add `#[buffer]` attribute macro that wraps unit-returning functions to
produce a `RenderResult` with an automatically injected buffer variable.
Relax `RenderResult::print()` and `println()` to accept `impl
AsRef<str>`.
Diffstat (limited to 'mingling_macros/src/extensions.rs')
| -rw-r--r-- | mingling_macros/src/extensions.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mingling_macros/src/extensions.rs b/mingling_macros/src/extensions.rs index aff20e2..022761b 100644 --- a/mingling_macros/src/extensions.rs +++ b/mingling_macros/src/extensions.rs @@ -13,6 +13,9 @@ use syn::{Ident, Token}; #[cfg(feature = "extra_macros")] pub(crate) mod routeify; +/// Extension: `#[buffer]` — wraps a unit-returning function to return `RenderResult`. +pub(crate) mod buffer; + /// Parsed extensions from an attribute macro like `#[chain(routeify, other_ext)]`. pub(crate) struct Extensions { pub(crate) exts: Vec<Ident>, |
