pub enum DecodeAction<Value> {
NeedInput {
required_total: usize,
},
Skip {
consumed: NonZeroUsize,
},
Emit {
value: Value,
consumed: NonZeroUsize,
},
}Expand description
Action selected after a codec decode attempt fails during transcode.
§Type Parameters
Value: Decoded output value type.
Variants§
NeedInput
More source units are needed before a value can be produced.
When returned by a decode hook, required_total must be greater than
the hook context’s available input count. Returning a value that is
already satisfied is a hook contract violation and panics in the engine.
Skip
Consume invalid input without producing output.
When returned by a decode hook, consumed must not exceed the hook
context’s available input count. Over-consuming is a hook contract
violation and panics in the engine.
Fields
consumed: NonZeroUsizeSource units to consume.
Emit
Produce one value and consume source units.
When returned by a decode hook, consumed must not exceed the hook
context’s available input count. Over-consuming is a hook contract
violation and panics in the engine.
Fields
value: ValueValue to write to the output buffer.
consumed: NonZeroUsizeSource units to consume.
Trait Implementations§
Source§impl<Value: Clone> Clone for DecodeAction<Value>
impl<Value: Clone> Clone for DecodeAction<Value>
Source§fn clone(&self) -> DecodeAction<Value>
fn clone(&self) -> DecodeAction<Value>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<Value: Copy> Copy for DecodeAction<Value>
Source§impl<Value: Debug> Debug for DecodeAction<Value>
impl<Value: Debug> Debug for DecodeAction<Value>
impl<Value: Eq> Eq for DecodeAction<Value>
Source§impl<Value: Hash> Hash for DecodeAction<Value>
impl<Value: Hash> Hash for DecodeAction<Value>
Source§impl<Value: PartialEq> PartialEq for DecodeAction<Value>
impl<Value: PartialEq> PartialEq for DecodeAction<Value>
Source§fn eq(&self, other: &DecodeAction<Value>) -> bool
fn eq(&self, other: &DecodeAction<Value>) -> bool
self and other values to be equal, and is used by ==.