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

Method sock_opt

crates/stdlib/src/socket.rs:986–989  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

984
985 impl PySocket {
986 pub fn sock_opt(&self) -> Option<PyMappedRwLockReadGuard<'_, Socket>> {
987 let sock = PyRwLockReadGuard::try_map(self.sock.read(), |sock| sock.as_ref());
988 sock.ok()
989 }
990
991 pub fn sock(&self) -> io::Result<PyMappedRwLockReadGuard<'_, Socket>> {
992 self.sock_opt()

Callers 2

selectMethod · 0.80
sockMethod · 0.80

Calls 3

okMethod · 0.80
readMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected