diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-21 03:46:06 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-21 03:46:06 +0800 |
| commit | c81485b6ae1ba80d658ad8e4482d384303b539ef (patch) | |
| tree | a15814ec00eeb06c4cacd989de0e9460ea8a328c /mingling/src/lib.rs | |
| parent | 7a438e07514ffc6b58b843dd8e42fa4088b95e71 (diff) | |
feat(core)!: replace RenderResult with buffered output model
Remove `Deref<Target=str>` and `render_text:String` in favor of
`render_buffer:Vec<(String, RenderResultMode)>` and an
`immediate_output`
flag. Add `RenderResultMode` enum, `r_eprint!`/`r_eprintln!` macros, and
new buffer manipulation methods (`append_to_buffer`, `eprint`, etc.).
Update `Display` to trim output and remove trailing newline. Migrate all
callers and tests away from `Deref` usage.
Diffstat (limited to 'mingling/src/lib.rs')
| -rw-r--r-- | mingling/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs index f5362d5..3539647 100644 --- a/mingling/src/lib.rs +++ b/mingling/src/lib.rs @@ -98,6 +98,12 @@ pub mod macros { /// `#[program_setup]` - Used to generate program setup #[cfg(feature = "extra_macros")] pub use mingling_macros::program_setup; + /// `r_eprint!` - Prints text to a `RenderResult` error buffer (without newline). + /// See the macro documentation for implicit vs. explicit buffer usage. + pub use mingling_macros::r_eprint; + /// `r_eprintln!` - Prints text to a `RenderResult` error buffer (with newline). + /// See the macro documentation for implicit vs. explicit buffer usage. + pub use mingling_macros::r_eprintln; /// `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; @@ -229,6 +235,12 @@ pub mod prelude { /// Like `pack!` but also marks the type for structured output #[cfg(all(feature = "macros", feature = "structural_renderer"))] pub use mingling_macros::pack_structural; + /// `r_eprint!` - Prints text to a `RenderResult` error buffer (without newline). + /// See the macro documentation for implicit vs. explicit buffer usage. + pub use mingling_macros::r_eprint; + /// `r_eprintln!` - Prints text to a `RenderResult` error buffer (with newline). + /// See the macro documentation for implicit vs. explicit buffer usage. + pub use mingling_macros::r_eprintln; /// `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; |
