pub struct Io<'a> {
pub input: &'a mut (dyn BufRead + Send),
pub out: &'a mut (dyn Write + Send),
pub err: &'a mut (dyn Write + Send),
}Expand description
The streams a verb uses (real stdio in Cli::run, buffers in tests). Send, so mcp can
read and write on their own threads.
Fields§
§input: &'a mut (dyn BufRead + Send)§out: &'a mut (dyn Write + Send)§err: &'a mut (dyn Write + Send)Implementations§
Source§impl Io<'_>
impl Io<'_>
Sourcepub fn fail(&mut self, json: bool, tool: &str, msg: impl Display) -> Exit
pub fn fail(&mut self, json: bool, tool: &str, msg: impl Display) -> Exit
A failure: with json, the reply line on stdout (as Io::reply); without it, one line
of plain text on stderr (<tool>: <message>), for a person reading a terminal.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Io<'a>
impl<'a> !Sync for Io<'a>
impl<'a> !UnwindSafe for Io<'a>
impl<'a> Freeze for Io<'a>
impl<'a> Send for Io<'a>
impl<'a> Unpin for Io<'a>
impl<'a> UnsafeUnpin for Io<'a>
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