Enum encoding::types::DecoderTrapStable [-]  [+] [src]

pub enum DecoderTrap {
    DecodeStrict,
    DecodeReplace,
    DecodeIgnore,
    DecoderCall(DecoderTrapFunc),
}

Trap, which handles decoder errors.

Variants

DecodeStrict

Immediately fails on errors. Corresponds to WHATWG "fatal" error algorithm.

DecodeReplace

Replaces an error with a U+FFFD (decoder). Corresponds to WHATWG "replacement" error algorithm.

DecodeIgnore

Silently ignores an error, effectively replacing it with an empty sequence.

DecoderCall

Calls given function to handle decoder errors. The function is given the current decoder, input and output writer, and should return true only when it is fine to keep going.