pub enum TranscodeStatus {
Complete,
NeedInput {
input_index: usize,
required: NonZeroUsize,
available: usize,
},
NeedOutput {
output_index: usize,
required: NonZeroUsize,
available: usize,
},
}Expand description
Reports why a crate::Transcoder stopped converting input.
Variants§
Complete
All currently supplied input was consumed.
NeedInput
More input is needed to complete the next output value.
The transcoder does not consume incomplete input tails. The caller
should preserve input[input_index..], refill the input buffer when
more data is available, or apply its EOF policy when the upstream
source is closed. Calling crate::Transcoder::finish does not pass
this tail back to the transcoder.
input_index: Absolute input index where input ended while decoding.required: Total input units required from the current input position.available: Number of input units currently available from the current input position.
Fields
required: NonZeroUsizeTotal input units required from the current input position.
NeedOutput
More output capacity is needed before conversion can continue.
output_index: Absolute output index where output ended while decoding.required: Total output units required from the current output position.available: Number of output units currently available from the current output position.
Implementations§
Source§impl TranscodeStatus
impl TranscodeStatus
Sourcepub const fn need_input(
input_index: usize,
required: NonZeroUsize,
available: usize,
) -> Self
pub const fn need_input( input_index: usize, required: NonZeroUsize, available: usize, ) -> Self
Creates a status that requests more input.
§Parameters
input_index: Absolute input boundary where conversion stopped.required: Total input units required from the current input position.available: Input units currently available at the boundary.
§Returns
Returns a TranscodeStatus::NeedInput value.
Sourcepub const fn need_output(
output_index: usize,
required: NonZeroUsize,
available: usize,
) -> Self
pub const fn need_output( output_index: usize, required: NonZeroUsize, available: usize, ) -> Self
Creates a status that requests more output capacity.
§Parameters
output_index: Absolute output boundary where conversion stopped.required: Total output units required from the current output position.available: Output units currently available at the boundary.
§Returns
Returns a TranscodeStatus::NeedOutput value.
Trait Implementations§
Source§impl Clone for TranscodeStatus
impl Clone for TranscodeStatus
Source§fn clone(&self) -> TranscodeStatus
fn clone(&self) -> TranscodeStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TranscodeStatus
Source§impl Debug for TranscodeStatus
impl Debug for TranscodeStatus
impl Eq for TranscodeStatus
Source§impl PartialEq for TranscodeStatus
impl PartialEq for TranscodeStatus
Source§fn eq(&self, other: &TranscodeStatus) -> bool
fn eq(&self, other: &TranscodeStatus) -> bool
self and other values to be equal, and is used by ==.