Trait WriteCompression

Source
pub trait WriteCompression<W: Write + Send + Sync + 'static> {
    // Required methods
    fn magic(&self) -> [u8; 5];
    fn meta(&self) -> &CodecMetadata;
    fn meta_mut(&mut self) -> &mut CodecMetadata;
    fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>;
    fn byte_align(&mut self) -> Result<()>;
    fn into_writer(self) -> Option<W>;
    fn flush_writer(&mut self) -> Result<()>;
    fn ingest_event(&mut self, event: Event) -> Result<(), CodecError>;
}
Expand description

A trait for writing ADΔER data to a stream.

Required Methods§

Source

fn magic(&self) -> [u8; 5]

The magic number for this compression format.

Source

fn meta(&self) -> &CodecMetadata

Returns a reference to the metadata

Source

fn meta_mut(&mut self) -> &mut CodecMetadata

Returns a mutable reference to the metadata

Source

fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>

Write the given bytes to the stream

Source

fn byte_align(&mut self) -> Result<()>

Align the bitstream to the next byte boundary

Source

fn into_writer(self) -> Option<W>

Consumes the compression stream and returns the underlying writer.

Source

fn flush_writer(&mut self) -> Result<()>

Flush the BitWriter. Does not flush the internal BufWriter.

Source

fn ingest_event(&mut self, event: Event) -> Result<(), CodecError>

Take in an event and process it. May or may not write to the output, depending on the state of the stream (Is it ready to write events? Is it accumulating/reorganizing events? etc.)

Implementors§

Source§

impl<W: Write + Send + Sync + 'static> WriteCompression<W> for WriteCompressionEnum<W>

Source§

impl<W: Write + Send + Sync + 'static> WriteCompression<W> for CompressedOutput<W>

Source§

impl<W: Write + Send + Sync + 'static> WriteCompression<W> for EmptyOutput<Sink>

Source§

impl<W: Write + Send + Sync + 'static> WriteCompression<W> for RawOutput<W>