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

Method as_fd

crates/vm/src/stdlib/_io.rs:96–100  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

94#[cfg(unix)]
95impl std::os::fd::AsFd for Fildes {
96 fn as_fd(&self) -> std::os::fd::BorrowedFd<'_> {
97 // SAFETY: none, really. but, python's os api of passing around file descriptors
98 // everywhere isn't really io-safe anyway, so, this is passed to the user.
99 unsafe { std::os::fd::BorrowedFd::borrow_raw(self.0) }
100 }
101}
102#[cfg(unix)]
103impl std::os::fd::AsRawFd for Fildes {

Callers 4

pipeFunction · 0.45
openptyFunction · 0.45
dupFunction · 0.45
dup2Function · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected