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§
Sourcefn encode_record_with_sym<R: DbnEncodable>(
&mut self,
record: &R,
symbol: Option<&str>,
) -> Result<()>
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§
Sourcefn encode_ref_with_sym(
&mut self,
record: RecordRef<'_>,
symbol: Option<&str>,
) -> Result<()>
fn encode_ref_with_sym( &mut self, record: RecordRef<'_>, symbol: Option<&str>, ) -> Result<()>
Sourceunsafe fn encode_ref_ts_out_with_sym(
&mut self,
record: RecordRef<'_>,
ts_out: bool,
symbol: Option<&str>,
) -> Result<()>
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.
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.