Skip to main content

DecodeInvalidActionOf

Type Alias DecodeInvalidActionOf 

Source
pub type DecodeInvalidActionOf<C> = DecodeInvalidAction<<C as Codec>::Value>;
Expand description

Invalid-decode action for a codec-backed decode hook.

§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.

Fields

§consumed: NonZero<usize>

Source 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: <C as Codec>::Value

Value to write to the output buffer.

§consumed: NonZero<usize>

Source units to consume.