Skip to main content

EncodeUnencodableActionOf

Type Alias EncodeUnencodableActionOf 

Source
pub type EncodeUnencodableActionOf<C> = EncodeUnencodableAction<<C as Codec>::Value>;
Expand description

Unencodable-value action for a codec-backed encode hook.

§Type Parameters

  • C: Codec whose associated Value is carried by replacement actions.

Aliased Type§

pub enum EncodeUnencodableActionOf<C> {
    Reject,
    Skip,
    Replace {
        value: <C as Codec>::Value,
    },
}

Variants§

§

Reject

Reject the current input value.

The encode engine reports crate::TranscodeEncodeError::Unencodable at the current input index.

§

Skip

Consume the current input value without producing output.

§

Replace

Encode a replacement value and consume the current input value.

The replacement must be encodable by the same codec. Returning an unencodable replacement is a hook contract violation and panics in the encode engine.

Fields

§value: <C as Codec>::Value

Replacement value to encode.