pub trait TranscodeEncoder: Transcoder<Error = TranscodeEncodeError<Self::EncodeError, <Self as Transcoder>::Input>> {
type EncodeError;
}Expand description
Encodes logical values into encoded units over caller-provided buffers.
TranscodeEncoder refines Transcoder for implementations whose
input is the logical value stream and whose output is the encoded unit
stream. The trait adds no methods; it exists to make generic bounds
distinguish encoding direction from decoding and unit-to-unit conversion.
The word “buffered” describes the caller-managed buffer and progress model.
It does not require the implementor to own an internal buffer. An encoder
may retain consumed input internally, but Transcoder::transcode must
consume every visible input value before returning
crate::TranscodeStatus::Complete and must never return
crate::TranscodeStatus::NeedInput. It returns
crate::TranscodeStatus::NeedOutput when more output capacity is needed;
Transcoder::finish emits any retained output after the caller has
supplied the complete logical input stream.
§Examples
use qubit_codec::TranscodeEncoder;
fn accepts_encoder<E: TranscodeEncoder>(encoder: &E) {
let _ = encoder;
}Required Associated Types§
Sourcetype EncodeError
type EncodeError
Domain error type produced by encode internals.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".