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

Method decode

crates/vm/src/stdlib/_io.rs:2693–2709  ·  view source on GitHub ↗
(
            &self,
            input: PyObjectRef,
            _final: OptionalArg<bool>,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

2691 impl StatelessIncrementalDecoder {
2692 #[pymethod]
2693 fn decode(
2694 &self,
2695 input: PyObjectRef,
2696 _final: OptionalArg<bool>,
2697 vm: &VirtualMachine,
2698 ) -> PyResult {
2699 let mut args: Vec<PyObjectRef> = vec![input];
2700 if let Some(errors) = &self.errors {
2701 args.push(errors.to_owned().into());
2702 }
2703 let res = self.decode.call(args, vm)?;
2704 let tuple: PyTupleRef = res.try_into_value(vm)?;
2705 if tuple.len() != 2 {
2706 return Err(vm.new_type_error("decoder must return a tuple (object, integer)"));
2707 }
2708 Ok(tuple[0].clone())
2709 }
2710
2711 #[pymethod]
2712 fn getstate(&self, vm: &VirtualMachine) -> (PyBytesRef, u64) {

Callers

nothing calls this directly

Calls 15

BorrowedClass · 0.85
OwnedClass · 0.85
try_into_valueMethod · 0.80
strip_suffixMethod · 0.80
contains_code_pointMethod · 0.80
push_wtf8Method · 0.80
ErrClass · 0.50
SomeClass · 0.50
pushMethod · 0.45
to_ownedMethod · 0.45
callMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected