Struct stdio::StdioReader
source · pub struct StdioReader { /* private fields */ }
Expand description
A reader to stdio buffers.
Implementations§
source§impl StdioReader
impl StdioReader
sourcepub fn lock(&self) -> StdioReadGuard<'_>
pub fn lock(&self) -> StdioReadGuard<'_>
Lock the reader and return a guard that can perform reading operation to that buffer. Note that this lock does not lock the underlying ring buffer. It only excludes other readr from performing simultaneous read, but does not prevent a writer to perform writing to the underlying ring buffer.
sourcepub fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
pub fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
Read a line from the ring buffer and return. Remaining bytes are stored in the inner
buffer. Do NOT use this function alternatively with read()
method defined in
StdioReadGuard
. This function returns the number of bytes read. It will return
zero only upon EOF.
Trait Implementations§
source§impl Clone for StdioReader
impl Clone for StdioReader
source§fn clone(&self) -> StdioReader
fn clone(&self) -> StdioReader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for StdioReader
impl Send for StdioReader
impl Sync for StdioReader
impl Unpin for StdioReader
impl !UnwindSafe for StdioReader
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