Trait EncodeRecord

Source
pub trait EncodeRecord {
    // Required methods
    fn encode_record<R: DbnEncodable>(&mut self, record: &R) -> Result<()>;
    fn flush(&mut self) -> Result<()>;
}
Expand description

Trait for types that encode a DBN record of a specific type.

Required Methods§

Source

fn encode_record<R: DbnEncodable>(&mut self, record: &R) -> Result<()>

Encodes a single DBN record of type R.

§Errors

This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.

Source

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

Flushes any buffered content to the true output.

§Errors

This function returns an error if it’s unable to flush the underlying writer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<W> EncodeRecord for dbn::encode::csv::Encoder<W>
where W: Write,

Source§

impl<W> EncodeRecord for dbn::encode::dbn::Encoder<W>
where W: Write,

Source§

impl<W> EncodeRecord for RecordEncoder<W>
where W: Write,

Source§

impl<W> EncodeRecord for dbn::encode::json::Encoder<W>
where W: Write,

Source§

impl<W> EncodeRecord for DynEncoder<'_, W>
where W: Write,