Struct sophon_wasm::elements::CountedWriter
[−]
[src]
pub struct CountedWriter<'a, W: 'a + Write> { /* fields omitted */ }
Helper struct to write payload which is preceded by it's own length in bytes.
Methods
impl<'a, W: 'a + Write> CountedWriter<'a, W>
[src]
fn new(writer: &'a mut W) -> Self
[src]
New counted writer on top of the given serial writer
fn done(self) -> Result<()>
[src]
Finish counted writer routing, which writes accumulated length and actual payload.
Trait Implementations
impl<'a, W: 'a + Write> Write for CountedWriter<'a, W>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Creates a "by reference" adaptor for this instance of Write
. Read more