pub enum EncodeOutcome {
Consumed {
written: usize,
},
NeedOutput {
required: NonZeroUsize,
},
}Expand description
Outcome returned by encode-side per-value hooks.
This is deliberately smaller than crate::TranscodeProgress. It only
describes what happened to the current input value; the encode engine owns
input/output cursor updates and progress construction.
Variants§
Consumed
The current input value was consumed.
NeedOutput
The current input value was not consumed because output is too small.
Fields
§
required: NonZeroUsizeTotal output units required from the current output cursor.
Implementations§
Source§impl EncodeOutcome
impl EncodeOutcome
Sourcepub const fn need_output(required: NonZeroUsize) -> Self
pub const fn need_output(required: NonZeroUsize) -> Self
Creates an outcome for insufficient output capacity.
Trait Implementations§
Source§impl Clone for EncodeOutcome
impl Clone for EncodeOutcome
Source§fn clone(&self) -> EncodeOutcome
fn clone(&self) -> EncodeOutcome
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 EncodeOutcome
Source§impl Debug for EncodeOutcome
impl Debug for EncodeOutcome
impl Eq for EncodeOutcome
Source§impl Hash for EncodeOutcome
impl Hash for EncodeOutcome
Source§impl PartialEq for EncodeOutcome
impl PartialEq for EncodeOutcome
Source§fn eq(&self, other: &EncodeOutcome) -> bool
fn eq(&self, other: &EncodeOutcome) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EncodeOutcome
Auto Trait Implementations§
impl Freeze for EncodeOutcome
impl RefUnwindSafe for EncodeOutcome
impl Send for EncodeOutcome
impl Sync for EncodeOutcome
impl Unpin for EncodeOutcome
impl UnsafeUnpin for EncodeOutcome
impl UnwindSafe for EncodeOutcome
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