pub trait EncodeDbn: EncodeRecord + EncodeRecordRef {
// Provided methods
fn encode_records<R: DbnEncodable>(&mut self, records: &[R]) -> Result<()> { ... }
fn encode_stream<R: DbnEncodable>(
&mut self,
stream: impl FallibleStreamingIterator<Item = R, Error = Error>,
) -> Result<()> { ... }
fn encode_decoded<D: DecodeRecordRef + DbnMetadata>(
&mut self,
decoder: D,
) -> Result<()> { ... }
fn encode_decoded_with_limit<D: DecodeRecordRef + DbnMetadata>(
&mut self,
decoder: D,
limit: NonZeroU64,
) -> Result<()> { ... }
}Expand description
Trait for types that encode DBN records with a specific record type.
Provided Methods§
Sourcefn encode_records<R: DbnEncodable>(&mut self, records: &[R]) -> Result<()>
fn encode_records<R: DbnEncodable>(&mut self, records: &[R]) -> Result<()>
Encodes a slice of DBN records.
§Errors
This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.
Sourcefn encode_stream<R: DbnEncodable>(
&mut self,
stream: impl FallibleStreamingIterator<Item = R, Error = Error>,
) -> Result<()>
fn encode_stream<R: DbnEncodable>( &mut self, stream: impl FallibleStreamingIterator<Item = R, Error = Error>, ) -> Result<()>
Encodes a stream of DBN records.
§Errors
This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.
Sourcefn encode_decoded<D: DecodeRecordRef + DbnMetadata>(
&mut self,
decoder: D,
) -> Result<()>
fn encode_decoded<D: DecodeRecordRef + DbnMetadata>( &mut self, decoder: D, ) -> Result<()>
Encodes DBN records directly from a DBN decoder.
§Errors
This function returns an error if it’s unable to write to the underlying writer or there’s a serialization error.
Sourcefn encode_decoded_with_limit<D: DecodeRecordRef + DbnMetadata>(
&mut self,
decoder: D,
limit: NonZeroU64,
) -> Result<()>
fn encode_decoded_with_limit<D: DecodeRecordRef + DbnMetadata>( &mut self, decoder: D, limit: NonZeroU64, ) -> Result<()>
Encodes DBN records directly from a DBN decoder, outputting no more than
limit records.
§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.