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

Method flush_rewind

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

Source from the content-addressed store, hash-verified

930 }
931
932 fn flush_rewind(&mut self, vm: &VirtualMachine) -> PyResult<()> {
933 self.flush(vm)?;
934 if self.readable() {
935 let res = self.raw_seek(-self.raw_offset(), 1, vm);
936 self.reset_read();
937 res?;
938 }
939 Ok(())
940 }
941
942 fn raw_seek(&mut self, pos: Offset, whence: i32, vm: &VirtualMachine) -> PyResult<Offset> {
943 let ret = vm.call_method(self.check_init(vm)?, "seek", (pos, whence))?;

Callers 7

read_genericMethod · 0.80
read_allMethod · 0.80
readinto_genericMethod · 0.80
truncateMethod · 0.80
peekMethod · 0.80
read1Method · 0.80
flushMethod · 0.80

Calls 5

raw_seekMethod · 0.80
raw_offsetMethod · 0.80
reset_readMethod · 0.80
flushMethod · 0.45
readableMethod · 0.45

Tested by

no test coverage detected