Trait Write
Other items inlzss
pub trait Write { type Output; type Error; fn write(&mut self, data: u8) -> Result<(), Self::Error>; fn finish(self) -> Result<Self::Output, Self::Error>; }
Trait for writing bytes.
type Output
The final output.
This will be often (), but for example the VecWriter returns the Vec.
()
Please see the example implementations.
type Error
The error which can happen during a write or finish operation.
Use Void when no error can be emitted.
fn write(&mut self, data: u8) -> Result<(), Self::Error>
Write a byte.
fn finish(self) -> Result<Self::Output, Self::Error>
Convert the writer into the output.
When the underlying structure requires a flush, call it in this routine.
Be aware that finish is not called when an error occurred.
finish
impl Write for VecWriter
impl<'a> Write for SliceWriter<'a>
impl<'a> Write for SliceWriterExact<'a>
impl<'a, W: Write> Write for IOSimpleWriter<'a, W>