Skip to main content

OutputRenderer

Trait OutputRenderer 

Source
pub trait OutputRenderer {
    // Required methods
    fn render_success<T: Serialize>(&self, command: &str, data: T) -> Result<()>;
    fn render_error(&self, command: &str, err: &SubXError) -> Result<()>;
}
Expand description

Renderer trait routing success/error envelopes to the active output stream.

The trait uses generic methods (not object-safe). Commands typically use the free emit_success/emit_error helpers instead of constructing renderers directly.

Required Methods§

Source

fn render_success<T: Serialize>(&self, command: &str, data: T) -> Result<()>

Emit a success envelope.

Source

fn render_error(&self, command: &str, err: &SubXError) -> Result<()>

Emit an error envelope.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§