pub struct Console { /* private fields */ }Expand description
System.in, System.out and System.err.
Implementations§
Source§impl Console
impl Console
pub fn std() -> Console
pub fn new( input: Box<dyn Read + Send>, out: Box<dyn Write + Send>, err: Box<dyn Write + Send>, ) -> Console
Sourcepub fn is_process_streams(&self) -> bool
pub fn is_process_streams(&self) -> bool
Whether this is the process’s own stdin/stdout/stderr, which a child process can inherit.
Sourcepub fn capture(stdin: &[u8]) -> (Console, Captured, Captured)
pub fn capture(stdin: &[u8]) -> (Console, Captured, Captured)
A console reading stdin and capturing stdout and stderr.
Sourcepub fn read_stdin(&self) -> Vec<u8> ⓘ
pub fn read_stdin(&self) -> Vec<u8> ⓘ
System.in.readBytes().
pub fn out(&self, text: &str)
pub fn err(&self, text: &str)
pub fn println_out(&self, line: &str)
pub fn println_err(&self, line: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Console
impl RefUnwindSafe for Console
impl Send for Console
impl Sync for Console
impl Unpin for Console
impl UnsafeUnpin for Console
impl UnwindSafe for Console
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