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

Method detach

crates/vm/src/stdlib/_io.rs:1700–1707  ·  view source on GitHub ↗
(zelf: PyRef<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1698 }
1699 #[pymethod]
1700 fn detach(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult {
1701 vm.call_method(zelf.as_object(), "flush", ())?;
1702 let mut data = zelf.lock(vm)?;
1703 data.flags.insert(BufferedFlags::DETACHED);
1704 data.raw
1705 .take()
1706 .ok_or_else(|| vm.new_value_error("raw stream has been detached"))
1707 }
1708
1709 #[pymethod]
1710 fn seekable(&self, vm: &VirtualMachine) -> PyResult {

Callers

nothing calls this directly

Implementers 1

_io.rscrates/vm/src/stdlib/_io.rs

Calls 6

ok_or_elseMethod · 0.80
call_methodMethod · 0.45
as_objectMethod · 0.45
lockMethod · 0.45
insertMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected