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

pub enum EncoderTrap {
    EncodeStrict,
    EncodeReplace,
    EncodeIgnore,
    EncodeNcrEscape,
    EncoderCall(EncoderTrapFunc),
}

Variants

EncodeStrict

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

EncodeReplace

Replaces an error with ? in given encoding. Note that this fails when ? cannot be represented in given encoding. Corresponds to WHATWG "URL" error algorithms.

EncodeIgnore

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

EncodeNcrEscape

Replaces an error with XML numeric character references (e.g. Ӓ). The encoder trap fails when NCRs cannot be represented in given encoding. Corresponds to WHATWG "

" error algorithms.

EncoderCall

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