pub enum RenderedOutput {
Text(TextOutput),
Binary(Vec<u8>, String),
Silent,
}Expand description
Output from a command, used in post-output hooks.
This represents the final output from a command handler after rendering.
Variants§
Text(TextOutput)
Text output with both formatted (ANSI) and raw versions.
The formatted field contains ANSI codes for terminal display.
The raw field contains the intermediate output for piping.
Binary(Vec<u8>, String)
Binary output with suggested filename
Silent
No output (silent command)
Implementations§
Source§impl RenderedOutput
impl RenderedOutput
Sourcepub fn as_text(&self) -> Option<&str>
pub fn as_text(&self) -> Option<&str>
Returns the formatted text content (with ANSI codes) if this is text output.
Sourcepub fn as_raw_text(&self) -> Option<&str>
pub fn as_raw_text(&self) -> Option<&str>
Returns the raw text content (without ANSI codes) if this is text output. This is the intermediate output suitable for piping.
Sourcepub fn as_text_output(&self) -> Option<&TextOutput>
pub fn as_text_output(&self) -> Option<&TextOutput>
Returns the full TextOutput if this is text output.
Trait Implementations§
Source§impl Clone for RenderedOutput
impl Clone for RenderedOutput
Source§fn clone(&self) -> RenderedOutput
fn clone(&self) -> RenderedOutput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RenderedOutput
impl RefUnwindSafe for RenderedOutput
impl Send for RenderedOutput
impl Sync for RenderedOutput
impl Unpin for RenderedOutput
impl UnsafeUnpin for RenderedOutput
impl UnwindSafe for RenderedOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more