Struct Interest
pub struct Interest(/* private field */);
Interest used in registering.
Interest are used in registering event::Sources with Poll, they
indicate what readiness should be monitored for. For example if a socket is
registered with readable interests and the socket becomes writable, no
event will be returned from a call to poll.
Implementations
impl Interest
const READABLE: Interest = _;Returns a
Interestset representing readable interests.const WRITABLE: Interest = _;Returns a
Interestset representing writable interests.const PRIORITY: Interest = _;Returns a
Interestset representing priority completion interests.const fn add(self, other: Interest) -> InterestAdd together two
Interest.This does the same thing as the
BitOrimplementation, but is a constant function.use Interest; const INTERESTS: Interest = READABLE.add; # # silent_dead_code_warningfn remove(self, other: Interest) -> Option<Interest>Removes
otherInterestfromself.Returns
Noneif the set would be empty after removingother.use Interest; const RW_INTERESTS: Interest = READABLE.add; // As long a one interest remain this will return `Some`. let w_interest = RW_INTERESTS.remove.unwrap; assert!; assert!; // Removing all interests from the set will return `None`. assert_eq!; // Its also possible to remove multiple interests at once. assert_eq!;const fn is_readable(self) -> boolReturns true if the value includes readable readiness.
const fn is_writable(self) -> boolReturns true if the value includes writable readiness.
const fn is_aio(self) -> boolReturns true if
Interestcontains AIO readiness.const fn is_lio(self) -> boolReturns true if
Interestcontains LIO readiness.const fn is_priority(self) -> boolReturns true if
Interestcontains priority readiness.
Trait Implementations
impl BitOr for Interest
type Output = Interest;fn bitor(self, other: Self) -> Self
impl BitOrAssign for Interest
fn bitor_assign(&mut self, other: Self)
impl Clone for Interest
fn clone(&self) -> Interest
impl Copy for Interest
impl Debug for Interest
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result
impl Eq for Interest
impl Ord for Interest
fn cmp(&self, other: &Interest) -> Ordering
impl PartialEq for Interest
fn eq(&self, other: &Interest) -> bool
impl PartialOrd for Interest
fn partial_cmp(&self, other: &Interest) -> Option<Ordering>
impl StructuralPartialEq for Interest
Auto Trait Implementations
impl Freeze for Interest
impl RefUnwindSafe for Interest
impl Send for Interest
impl Sync for Interest
impl Unpin for Interest
impl UnsafeUnpin for Interest
impl UnwindSafe for Interest
Blanket Implementations
impl<T> Any for Interest
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Interest
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Interest
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Interest
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Interest
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Interest
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Interest
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Interest
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Interest
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>