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§
Sourcefn meta(&self) -> &CodecMetadata
fn meta(&self) -> &CodecMetadata
Returns a reference to the metadata
Sourcefn meta_mut(&mut self) -> &mut CodecMetadata
fn meta_mut(&mut self) -> &mut CodecMetadata
Returns a mutable reference to the metadata
Sourcefn write_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
Write the given bytes to the stream
Sourcefn byte_align(&mut self) -> Result<()>
fn byte_align(&mut self) -> Result<()>
Align the bitstream to the next byte boundary
Sourcefn into_writer(self) -> Option<W>
fn into_writer(self) -> Option<W>
Consumes the compression stream and returns the underlying writer.
Sourcefn flush_writer(&mut self) -> Result<()>
fn flush_writer(&mut self) -> Result<()>
Flush the BitWriter
. Does not flush the internal BufWriter
.
Sourcefn ingest_event(&mut self, event: Event) -> Result<(), CodecError>
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.)