pub enum RenderedOutput {
Text(TextOutput),
Binary(Vec<u8>, String),
Artifact(ArtifactOutput),
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
Artifact(ArtifactOutput)
A compound artifact awaiting the framework-owned write.
Silent
No output (silent command)
Implementations§
Source§impl RenderedOutput
impl RenderedOutput
Sourcepub fn is_artifact(&self) -> bool
pub fn is_artifact(&self) -> bool
Returns true if this is a compound artifact awaiting the final write.
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.
Sourcepub fn as_binary(&self) -> Option<(&[u8], &str)>
pub fn as_binary(&self) -> Option<(&[u8], &str)>
Returns the binary content and filename if this is binary output.
Sourcepub fn as_artifact(&self) -> Option<&ArtifactOutput>
pub fn as_artifact(&self) -> Option<&ArtifactOutput>
Returns the pending artifact if this is artifact output.
Sourcepub fn as_artifact_mut(&mut self) -> Option<&mut ArtifactOutput>
pub fn as_artifact_mut(&mut self) -> Option<&mut ArtifactOutput>
Returns the pending artifact mutably, for hooks that transform bytes or enrich the report before the framework-owned write.
Trait Implementations§
Source§impl Clone for RenderedOutput
impl Clone for RenderedOutput
Source§fn clone(&self) -> RenderedOutput
fn clone(&self) -> RenderedOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more