Trait dbn::encode::EncodeRecordTextExt

source ·
pub trait EncodeRecordTextExt: EncodeRecord + EncodeRecordRef {
    // Required method
    fn encode_record_with_sym<R: DbnEncodable>(
        &mut self,
        record: &R,
        symbol: Option<&str>,
    ) -> Result<()>;

    // Provided methods
    fn encode_ref_with_sym(
        &mut self,
        record: RecordRef<'_>,
        symbol: Option<&str>,
    ) -> Result<()> { ... }
    unsafe fn encode_ref_ts_out_with_sym(
        &mut self,
        record: RecordRef<'_>,
        ts_out: bool,
        symbol: Option<&str>,
    ) -> Result<()> { ... }
}
Expand description

Extension trait for text encodings.

Required Methods§

source

fn encode_record_with_sym<R: DbnEncodable>( &mut self, record: &R, symbol: Option<&str>, ) -> Result<()>

Encodes a single DBN record of type R along with the record’s text symbol.

§Errors

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

Provided Methods§

source

fn encode_ref_with_sym( &mut self, record: RecordRef<'_>, symbol: Option<&str>, ) -> Result<()>

Encodes a single DBN RecordRef along with the record’s text symbol.

§Errors

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

source

unsafe fn encode_ref_ts_out_with_sym( &mut self, record: RecordRef<'_>, ts_out: bool, symbol: Option<&str>, ) -> Result<()>

Encodes a single DBN RecordRef with an optional ts_out (see record::WithTsOut) along with the record’s text symbol.

§Safety

ts_out must be false if record does not have an appended ts_out.

§Errors

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, W> EncodeRecordTextExt for DynEncoder<'a, W>
where W: Write,

source§

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

source§

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