pub struct FdSet(/* private fields */);
Implementations§
Source§impl FdSet
impl FdSet
pub fn new() -> FdSet
pub fn insert(&mut self, fd: RawFd)
pub fn remove(&mut self, fd: RawFd)
pub fn contains(&mut self, fd: RawFd) -> bool
pub fn clear(&mut self)
Sourcepub fn fds(&mut self, highest: Option<RawFd>) -> Fds<'_> ⓘ
pub fn fds(&mut self, highest: Option<RawFd>) -> Fds<'_> ⓘ
Returns an iterator over the file descriptors in the set.
For performance, it takes an optional higher bound: the iterator will not return any elements of the set greater than the given file descriptor.
§Examples
let mut set = FdSet::new();
set.insert(4);
set.insert(9);
let fds: Vec<RawFd> = set.fds(None).collect();
assert_eq!(fds, vec![4, 9]);
Trait Implementations§
impl Copy for FdSet
impl Eq for FdSet
impl StructuralPartialEq for FdSet
Auto Trait Implementations§
impl Freeze for FdSet
impl RefUnwindSafe for FdSet
impl Send for FdSet
impl Sync for FdSet
impl Unpin for FdSet
impl UnwindSafe for FdSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more