MCPcopy Index your code
hub / github.com/RustPython/RustPython / handle_error

Method handle_error

crates/common/src/encodings.rs:39–51  ·  view source on GitHub ↗
(
        &mut self,
        errors: &E,
        range: Range<StrSize>,
        reason: Option<&str>,
    )

Source from the content-addressed store, hash-verified

37 fn error_encoding(&self, range: Range<StrSize>, reason: Option<&str>) -> Self::Error;
38
39 fn handle_error<E>(
40 &mut self,
41 errors: &E,
42 range: Range<StrSize>,
43 reason: Option<&str>,
44 ) -> Result<EncodeReplace<Self>, Self::Error>
45 where
46 E: EncodeErrorHandler<Self>,
47 {
48 let (replace, restart) = errors.handle_encode_error(self, range, reason)?;
49 self.restart_from(restart)?;
50 Ok(replace)
51 }
52}
53
54pub trait DecodeContext: CodecContext {

Callers 3

decode_utf8_compatibleFunction · 0.45
encode_utf8_compatibleFunction · 0.45
encodeFunction · 0.45

Implementers 1

codecs.rscrates/vm/src/codecs.rs

Calls 2

restart_fromMethod · 0.80
handle_encode_errorMethod · 0.45

Tested by

no test coverage detected