pub enum DecodeInvalidAction<Value> {
Skip {
consumed: NonZeroUsize,
},
Emit {
value: Value,
consumed: NonZeroUsize,
},
}Expand description
Action selected after a codec reports invalid encoded input.
Incomplete input is not a policy action. Codecs report it with
crate::DecodeFailure::Incomplete, and the decode engine converts it
directly into crate::TranscodeStatus::NeedInput.
§Type Parameters
Value: Decoded output value type.
Variants§
Skip
Consume invalid input without producing output.
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 replacement value and consume source units.
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 DecodeInvalidAction<Value>
impl<Value: Clone> Clone for DecodeInvalidAction<Value>
Source§fn clone(&self) -> DecodeInvalidAction<Value>
fn clone(&self) -> DecodeInvalidAction<Value>
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<Value: Copy> Copy for DecodeInvalidAction<Value>
Source§impl<Value: Debug> Debug for DecodeInvalidAction<Value>
impl<Value: Debug> Debug for DecodeInvalidAction<Value>
impl<Value: Eq> Eq for DecodeInvalidAction<Value>
Source§impl<Value: Hash> Hash for DecodeInvalidAction<Value>
impl<Value: Hash> Hash for DecodeInvalidAction<Value>
Source§impl<Value: PartialEq> PartialEq for DecodeInvalidAction<Value>
impl<Value: PartialEq> PartialEq for DecodeInvalidAction<Value>
Source§fn eq(&self, other: &DecodeInvalidAction<Value>) -> bool
fn eq(&self, other: &DecodeInvalidAction<Value>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<Value: PartialEq> StructuralPartialEq for DecodeInvalidAction<Value>
Auto Trait Implementations§
impl<Value> Freeze for DecodeInvalidAction<Value>where
Value: Freeze,
impl<Value> RefUnwindSafe for DecodeInvalidAction<Value>where
Value: RefUnwindSafe,
impl<Value> Send for DecodeInvalidAction<Value>where
Value: Send,
impl<Value> Sync for DecodeInvalidAction<Value>where
Value: Sync,
impl<Value> Unpin for DecodeInvalidAction<Value>where
Value: Unpin,
impl<Value> UnsafeUnpin for DecodeInvalidAction<Value>where
Value: UnsafeUnpin,
impl<Value> UnwindSafe for DecodeInvalidAction<Value>where
Value: UnwindSafe,
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