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

Method raw_tell

crates/vm/src/stdlib/_io.rs:990–1001  ·  view source on GitHub ↗
(&mut self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

988 }
989
990 fn raw_tell(&mut self, vm: &VirtualMachine) -> PyResult<Offset> {
991 let raw = self.check_init(vm)?;
992 let ret = vm.call_method(raw, "tell", ())?;
993 let offset = get_offset(ret, vm)?;
994 if offset < 0 {
995 return Err(
996 vm.new_os_error(format!("Raw stream returned invalid position {offset}"))
997 );
998 }
999 self.abs_pos = offset;
1000 Ok(offset)
1001 }
1002
1003 fn raw_tell_cache(&mut self, vm: &VirtualMachine) -> PyResult<Offset> {
1004 if self.abs_pos == -1 {

Callers 3

raw_tell_cacheMethod · 0.80
tellMethod · 0.80
truncateMethod · 0.80

Calls 5

get_offsetFunction · 0.85
check_initMethod · 0.80
new_os_errorMethod · 0.80
ErrClass · 0.50
call_methodMethod · 0.45

Tested by

no test coverage detected