Struct std::io::StdioStream
Standard I/O stream.
Fields
-
fd: FileDescriptor
Methods
impl StdioStream { ... }
-
fn stdin() -> StdioStream
Standard input
-
fn stdout() -> StdioStream
Standard output
-
fn stderr() -> StdioStream
Standard error
-
fn as_fd(self: &StdioStream) -> FileDescriptor
-
fn close(self: &mut StdioStream) -> Result<()>
Close the stream.
-
fn flush(self: &mut StdioStream) -> Result<()>
Flush the stream.
-
fn move(self: &mut StdioStream) -> StdioStream
Mixins
impl StdioStream { ... }
-
mixin FdReadWrite<StdioStream>
-
Reads from the stream into a provided buffer.
If successful, returns the number of bytes read. This may be less than the size of the provided buffer.
-
Write the buffer to the stream.
Returns the number of bytes written. This may be less than the size of the buffer. See also write_all, which can be used to write the entire buffer.
-
mixin Readable<StdioStream>
-
Fills the provided buffer by reading from the stream.
If stream had less bytes available than the size of the buffer, this method will return an
Error::eof()
. -
Reads the entire stream into a
StringBuf
.If successful, returns the number of bytes that were read.
-
mixin Writable<StdioStream>
-
Writes all the bytes in the buffer to the stream.
If EOF is reached, returns
Error::eof()
.