aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/lib.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-20 08:42:16 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-20 08:42:16 +0800
commit7b3a1d7fd9f60b91a7f9602374c081882d46facc (patch)
treedc0c8a9bf095308e6d29091db4b5037c29ed5742 /mingling/src/lib.rs
parent9dc737acec1eab40ef65bef8e6c729a4e5e06401 (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/src/lib.rs')
-rw-r--r--mingling/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs
index a34452d..d1691fb 100644
--- a/mingling/src/lib.rs
+++ b/mingling/src/lib.rs
@@ -42,6 +42,8 @@ pub mod macros {
/// New Parser provided by the `picker` feature
#[cfg(feature = "picker")]
pub use arg_picker::macros::*;
+ /// `#[buffer]` - Wraps a unit-returning function to produce a `RenderResult`.
+ pub use mingling_macros::buffer;
/// `#[chain]` - Used to generate a struct implementing the `Chain` trait via a method
pub use mingling_macros::chain;
/// `#[completion(EntryType)]` - Used to generate completion entry
@@ -91,6 +93,12 @@ pub mod macros {
/// `#[program_setup]` - Used to generate program setup
#[cfg(feature = "extra_macros")]
pub use mingling_macros::program_setup;
+ /// `r_print!` - Prints text to a `RenderResult` buffer (without newline).
+ /// See the macro documentation for implicit vs. explicit buffer usage.
+ pub use mingling_macros::r_print;
+ /// `r_println!` - Prints text to a `RenderResult` buffer (with newline).
+ /// See the macro documentation for implicit vs. explicit buffer usage.
+ pub use mingling_macros::r_println;
#[doc(hidden)]
pub use mingling_macros::register_chain;
#[doc(hidden)]