pub trait Printer {
// Required methods
fn out<T: Display + Serialize>(&mut self, data: T) -> Result<()>;
fn event<T: Display + Serialize>(&mut self, event: T) -> Result<()>;
fn out_bytes(&mut self, bytes: Bytes) -> 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§
Sourcefn out<T: Display + Serialize>(&mut self, data: T) -> Result<()>
fn out<T: Display + Serialize>(&mut self, data: T) -> Result<()>
Writes the result of the command, as text or JSON.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".