Skip to main content

FdSet

Struct FdSet 

Source
pub struct FdSet(/* private fields */);
Expand description

File descriptor set for the virtual system

This is an implementation of the FdSet trait for the VirtualSystem. It represents a set of file descriptors that can be monitored for events such as readability or writability in the virtual system. Currently, the FdSet struct internally uses a BTreeSet to store the file descriptors, which allows for efficient insertion, removal, and lookup of file descriptors.

Implementations§

Source§

impl FdSet

Source

pub fn len(&self) -> usize

Returns the number of file descriptors in the set.

Source

pub fn is_empty(&self) -> bool

Returns whether the set is empty.

Source

pub fn iter(&self) -> Iter<'_>

Returns an iterator over the file descriptors in the set.

Trait Implementations§

Source§

impl Clone for FdSet

Source§

fn clone(&self) -> FdSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FdSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FdSet

Source§

fn default() -> FdSet

Returns the “default value” for a type. Read more
Source§

impl<'a> Extend<&'a Fd> for FdSet

Source§

fn extend<I: IntoIterator<Item = &'a Fd>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extend<Fd> for FdSet

Source§

fn extend<I: IntoIterator<Item = Fd>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl FdSet for FdSet

Source§

const MAX_FD: Fd

The maximum FD that can be stored in the set. This corresponds to FD_SETSIZE - 1 in C libraries. The exact value may depend on the implementation.
Source§

fn insert(&mut self, fd: Fd)

Adds an FD to the set. Read more
Source§

fn remove(&mut self, fd: Fd)

Removes an FD from the set. Read more
Source§

fn contains(&self, fd: Fd) -> bool

Checks if an FD is in the set. Read more
Source§

fn new() -> Self

Creates a new, empty FD set. Read more
Source§

fn from_fds<I>(iter: I) -> Self
where I: IntoIterator<Item = Fd>,

Creates a new FD set from an iterator of FDs. Read more
Source§

impl From<Fd> for FdSet

Source§

fn from(fd: Fd) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<Fd> for FdSet

Source§

fn from_iter<I: IntoIterator<Item = Fd>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> IntoIterator for &'a FdSet

Source§

type Item = &'a Fd

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for FdSet

Source§

type Item = Fd

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for FdSet

Source§

fn eq(&self, other: &FdSet) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for FdSet

Source§

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 UnsafeUnpin for FdSet

§

impl UnwindSafe for FdSet

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.