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

Method handle_encode_error

crates/common/src/encodings.rs:269–276  ·  view source on GitHub ↗
(
            &self,
            ctx: &mut Ctx,
            range: Range<StrSize>,
            reason: Option<&str>,
        )

Source from the content-addressed store, hash-verified

267
268 impl<Ctx: EncodeContext> EncodeErrorHandler<Ctx> for Strict {
269 fn handle_encode_error(
270 &self,
271 ctx: &mut Ctx,
272 range: Range<StrSize>,
273 reason: Option<&str>,
274 ) -> Result<(EncodeReplace<Ctx>, StrSize), Ctx::Error> {
275 Err(ctx.error_encoding(range, reason))
276 }
277 }
278
279 impl<Ctx: DecodeContext> DecodeErrorHandler<Ctx> for Strict {

Callers 1

handle_errorMethod · 0.45

Calls 15

BytesClass · 0.85
error_encodingMethod · 0.80
full_dataMethod · 0.80
code_pointsMethod · 0.80
len_wtf8Method · 0.80
ErrClass · 0.50
StrClass · 0.50
bytesMethod · 0.45
repeatMethod · 0.45
stringMethod · 0.45
unwrapMethod · 0.45
to_u32Method · 0.45

Tested by

no test coverage detected