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

Method new

crates/stdlib/src/select.rs:147–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145
146impl FdSet {
147 pub fn new() -> Self {
148 // it's just ints, and all the code that's actually
149 // interacting with it is in C, so it's safe to zero
150 let mut fdset = core::mem::MaybeUninit::zeroed();
151 unsafe { platform::FD_ZERO(fdset.as_mut_ptr()) };
152 Self(fdset)
153 }
154
155 pub fn insert(&mut self, fd: RawFd) {
156 unsafe { platform::FD_SET(fd, self.0.as_mut_ptr()) };

Callers

nothing calls this directly

Calls 5

FD_ZEROFunction · 0.85
SelfFunction · 0.85
as_mut_ptrMethod · 0.80
createFunction · 0.70
SomeClass · 0.50

Tested by

no test coverage detected