Skip to main content

Printer

Trait Printer 

Source
pub trait Printer {
    // Required method
    fn out<T: Display + Serialize>(&mut self, data: T) -> Result<()>;

    // Provided method
    fn is_json(&self) -> bool { ... }
}
Available on crate feature terminal only.
Expand description

Sink a command writes its output to.

Required Methods§

Source

fn out<T: Display + Serialize>(&mut self, data: T) -> Result<()>

Writes one piece of command output, as text or JSON.

Provided Methods§

Source

fn is_json(&self) -> bool

Whether the printer emits JSON.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§