pub enum TranscodeStatus {
Complete,
NeedInput {
input_index: usize,
additional: NonZeroUsize,
available: usize,
},
NeedOutput {
output_index: usize,
additional: NonZeroUsize,
available: usize,
},
}Expand description
Reports why a crate::BufferedTranscoder 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.
input_index: Absolute input index where input ended while decoding.additional: Number of additional input units required to continue.available: Number of input units currently available from the current input position.
Fields
§
additional: NonZeroUsizeNumber of additional input units required to continue.
NeedOutput
More output capacity is needed before conversion can continue.
output_index: Absolute output index where output ended while decoding.additional: Number of additional output units required to continue.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,
additional: NonZeroUsize,
available: usize,
) -> Self
pub const fn need_input( input_index: usize, additional: NonZeroUsize, available: usize, ) -> Self
Creates a status that requests more input.
§Parameters
input_index: Absolute input boundary where conversion stopped.additional: Additional input units required to continue.available: Input units currently available at the boundary.
§Returns
Returns a TranscodeStatus::NeedInput value.
Sourcepub const fn need_output(
output_index: usize,
additional: NonZeroUsize,
available: usize,
) -> Self
pub const fn need_output( output_index: usize, additional: NonZeroUsize, available: usize, ) -> Self
Creates a status that requests more output capacity.
§Parameters
output_index: Absolute output boundary where conversion stopped.additional: Additional output units required to continue.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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TranscodeStatus
Auto Trait Implementations§
impl Freeze for TranscodeStatus
impl RefUnwindSafe for TranscodeStatus
impl Send for TranscodeStatus
impl Sync for TranscodeStatus
impl Unpin for TranscodeStatus
impl UnsafeUnpin for TranscodeStatus
impl UnwindSafe for TranscodeStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more