pub type DecodeInvalidActionOf<C> = DecodeInvalidAction<<C as Codec>::Value>;Expand description
Invalid-decode action type used by a codec-backed decode hook.
This alias binds the action’s replacement value to the codec’s decoded value type, so hook implementations can name their result in terms of the codec they serve.
§Type Parameters
C: Codec whose decoded value is carried by replacement actions.
Aliased Type§
pub enum DecodeInvalidActionOf<C> {
Reject,
Skip {
consumed: NonZero<usize>,
},
Emit {
value: <C as Codec>::Value,
consumed: NonZero<usize>,
},
}Variants§
Reject
Reject the current invalid input.
The decode engine reports the original codec decode error as
crate::TranscodeDecodeError::Domain at the current input index.
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.
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.