Struct stdio::StdioWriteGuard
source · pub struct StdioWriteGuard<'a> { /* private fields */ }Expand description
StdioReadGuard acts like MutexGuard, it locks the underlying ring buffer during its
lifetime, and provides writing methods to the ring buffer. The lock will be automatically
released on dropping of this structure.
Implementations§
source§impl<'a> StdioWriteGuard<'a>
impl<'a> StdioWriteGuard<'a>
Trait Implementations§
source§impl<'a> Write for StdioWriteGuard<'a>
impl<'a> Write for StdioWriteGuard<'a>
source§fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write to the ring buffer, returniong the number of bytes written.
When this method is called after setting the EOF flag, it returns error with ErrorKind
set to UnexpectedEof.
Also note that this method does not guarantee to write all given bytes, although it currently
does so. Always check the return value when using this method. Otherwise, use write_all to
ensure that all given bytes are written.
source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
The function required by Write trait. Currently it performs nothing,
since everything is write directly to the ring buffer in write method.