/// Handles a decoder error. May write to the output writer.
/// Returns true only when it is fine to keep going.
Handles a decoder error. May write to the output writer.
Returns true only when it is fine to keep going.
Handles a decoder error . May write to the output writer . Returns true only when it is fine to keep going .
pub fn trap(&self, decoder: &mut RawDecoder, input: &[u8], output: &mut StringWriter) -> bool {
        match *self {
            DecoderTrap::Strict     => false,
            DecoderTrap::Replace    => { output.write_char('\u{fffd}'); true },
            DecoderTrap::Ignore     => true,
            DecoderTrap::Call(func) => func(decoder, input, output),
        }
    }
pub fn trap ( & self , decoder : & mut RawDecoder , input : & [ u8 ] , output : & mut StringWriter ) -> bool { match * self { DecoderTrap :: Strict => false , DecoderTrap :: Replace => { output . write_char ( '\u{fffd}' ) ; true } , DecoderTrap :: Ignore => true , DecoderTrap :: Call ( func ) => func ( decoder , input , output ) , } }
Handles a decoder error.
Handles a decoder error .
&self
decoder
&mut RawDecoder
input
&[u8]
output
&mut StringWriter