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

Function check_seekable

crates/vm/src/stdlib/_io.rs:391–400  ·  view source on GitHub ↗
(file: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

389 }
390
391 fn check_seekable(file: &PyObject, vm: &VirtualMachine) -> PyResult<()> {
392 if vm.call_method(file, "seekable", ())?.try_to_bool(vm)? {
393 Ok(())
394 } else {
395 Err(new_unsupported_operation(
396 vm,
397 "File or stream is not seekable".to_owned(),
398 ))
399 }
400 }
401
402 fn check_decoded(decoded: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyStrRef> {
403 decoded.downcast().map_err(|obj| {

Callers 3

check_seekableMethod · 0.85
initMethod · 0.85
seekMethod · 0.85

Calls 5

try_to_boolMethod · 0.80
ErrClass · 0.50
call_methodMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected