Struct FdSet
struct FdSet<'fd> { ... }
Contains a set of file descriptors used by select
Implementations
impl<'fd> FdSet<'fd>
fn new() -> FdSet<'fd>Create an empty
FdSetfn insert(self: &mut Self, fd: BorrowedFd<'fd>)Add a file descriptor to an
FdSetfn remove(self: &mut Self, fd: BorrowedFd<'fd>)Remove a file descriptor from an
FdSetfn contains(self: &Self, fd: BorrowedFd<'fd>) -> boolTest an
FdSetfor the presence of a certain file descriptor.fn clear(self: &mut Self)Remove all file descriptors from this
FdSet.fn highest(self: &Self) -> Option<BorrowedFd<'_>>Finds the highest file descriptor in the set.
Returns
Noneif the set is empty.This can be used to calculate the
nfdsparameter of theselectfunction.Example
# use ; # use FdSet; let fd_four = unsafe ; let fd_nine = unsafe ; let mut set = new; set.insert; set.insert; assert_eq!;fn fds(self: &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
# use FdSet; # use ; let mut set = new; let fd_four = unsafe ; let fd_nine = unsafe ; set.insert; set.insert; let fds: = set.fds.map.collect; assert_eq!;
impl Default for FdSet<'_>
fn default() -> Self
impl<'fd> Clone for FdSet<'fd>
fn clone(self: &Self) -> FdSet<'fd>
impl<'fd> Copy for FdSet<'fd>
impl<'fd> Debug for FdSet<'fd>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<'fd> Eq for FdSet<'fd>
impl<'fd> Freeze for FdSet<'fd>
impl<'fd> Hash for FdSet<'fd>
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl<'fd> PartialEq for FdSet<'fd>
fn eq(self: &Self, other: &FdSet<'fd>) -> bool
impl<'fd> RefUnwindSafe for FdSet<'fd>
impl<'fd> Send for FdSet<'fd>
impl<'fd> StructuralPartialEq for FdSet<'fd>
impl<'fd> Sync for FdSet<'fd>
impl<'fd> Unpin for FdSet<'fd>
impl<'fd> UnsafeUnpin for FdSet<'fd>
impl<'fd> UnwindSafe for FdSet<'fd>
impl<T> Any for FdSet<'fd>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for FdSet<'fd>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for FdSet<'fd>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for FdSet<'fd>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for FdSet<'fd>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for FdSet<'fd>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for FdSet<'fd>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for FdSet<'fd>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for FdSet<'fd>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>