pub struct CapturePrinter {
pub values: Vec<Value>,
pub events: Vec<Value>,
}Available on crate feature
terminal only.Expand description
A Printer keeping each value and event a command prints as JSON,
for a caller that hands them on rather than printing them.
Fields§
§values: Vec<Value>The values printed, in order.
events: Vec<Value>The events printed, in order.
Implementations§
Source§impl CapturePrinter
impl CapturePrinter
Sourcepub fn into_single(self) -> Result<Value>
pub fn into_single(self) -> Result<Value>
The one value the command printed, failing when it printed none or several.
Trait Implementations§
Source§impl Debug for CapturePrinter
impl Debug for CapturePrinter
Source§impl Default for CapturePrinter
impl Default for CapturePrinter
Source§impl Printer for CapturePrinter
impl Printer for CapturePrinter
Source§fn 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.
Source§fn event<T: Display + Serialize>(&mut self, event: T) -> Result<()>
fn event<T: Display + Serialize>(&mut self, event: T) -> Result<()>
Writes an event, something the command observed while running,
before its result. Read more
Auto Trait Implementations§
impl Forget for CapturePrinter
impl Freeze for CapturePrinter
impl Move for CapturePrinter
impl RefUnwindSafe for CapturePrinter
impl Send for CapturePrinter
impl Sync for CapturePrinter
impl Unpin for CapturePrinter
impl UnsafeUnpin for CapturePrinter
impl UnwindSafe for CapturePrinter
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