Struct std::io::StringWriter
A writable stream backed by StringBuf.
Fields
-
string: &mut StringBuf
Methods
impl StringWriter { ... }
-
fn new(string: &mut StringBuf) -> StringWriter
-
fn write(self: &mut StringWriter, buf: &[u8]) -> Result<usize>
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.
-
fn flush(self: &mut StringWriter) -> Result<()>
Flush the stream
This may be a no-op, depending on the stream.
Mixins
impl StringWriter { ... }
-
mixin Writable<StringWriter>
-
Writes all the bytes in the buffer to the stream.
If EOF is reached, returns
Error::eof()
.