Trait lzss::Write

source ·
pub trait Write {
    type Output;
    type Error;

    // Required methods
    fn write(&mut self, data: u8) -> Result<(), Self::Error>;
    fn finish(self) -> Result<Self::Output, Self::Error>;
}
Expand description

Trait for writing bytes.

Required Associated Types§

source

type Output

The final output.

This will be often (), but for example the VecWriter returns the Vec.

Please see the example implementations.

source

type Error

The error which can happen during a write or finish operation.

Use Void when no error can be emitted.

Required Methods§

source

fn write(&mut self, data: u8) -> Result<(), Self::Error>

Write a byte.

source

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.

Implementors§