pub struct Stdio { /* private fields */ }
Expand description
A ring buffer containing bytes. It forms stdin
, stdout
and stderr
.
The two Arc
s actually point to the same ring buffer. It is designed to prevent
interleaved reading but at the same time allow writing to the ring buffer while
the reader is holding its lock, and vice versa.
Implementations§
source§impl Stdio
impl Stdio
sourcepub fn get_reader(&self) -> StdioReader
pub fn get_reader(&self) -> StdioReader
Get a reader to the stdio buffer. Note that each reader has its own
inner buffer. The buffer size is set to be 256 bytes. Resort to
get_reader_with_buf_capacity
if one needs a different buffer size.
sourcepub fn get_reader_with_buf_capacity(&self, capacity: usize) -> StdioReader
pub fn get_reader_with_buf_capacity(&self, capacity: usize) -> StdioReader
Get a reader to the stdio buffer with a customized buffer size. Note that each reader has its own inner buffer.
sourcepub fn get_writer(&self) -> StdioWriter
pub fn get_writer(&self) -> StdioWriter
Get a writer to the stdio buffer.
Auto Trait Implementations§
impl !RefUnwindSafe for Stdio
impl Send for Stdio
impl Sync for Stdio
impl Unpin for Stdio
impl !UnwindSafe for Stdio
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