Struct Interest
pub struct Interest(/* private field */);
Readiness event interest.
Specifies the readiness events the caller is interested in when awaiting on I/O resource readiness states.
Implementations
impl Interest
const READABLE: Interest = _;Interest in all readable events.
Readable interest includes read-closed events.
const WRITABLE: Interest = _;Interest in all writable events.
Writable interest includes write-closed events.
const ERROR: Interest = _;Interest in error events.
Passes error interest to the underlying OS selector. Behavior is platform-specific, read your platform's documentation.
const PRIORITY: Interest = _;Returns a
Interestset representing priority completion interests.const fn is_readable(self) -> boolReturns true if the value includes readable interest.
Examples
use Interest; assert!; assert!; let both = READABLE | WRITABLE; assert!;const fn is_writable(self) -> boolReturns true if the value includes writable interest.
Examples
use Interest; assert!; assert!; let both = READABLE | WRITABLE; assert!;const fn is_error(self) -> boolReturns true if the value includes error interest.
Examples
use Interest; assert!; assert!; let combined = READABLE | ERROR; assert!;const fn is_priority(self) -> boolReturns true if the value includes priority interest.
Examples
use Interest; assert!; assert!; let both = READABLE | PRIORITY; assert!;const fn add(self, other: Interest) -> InterestAdd together two
Interestvalues.This function works from a
constcontext.Examples
use Interest; const BOTH: Interest = READABLE.add; assert!; assert!;fn remove(self, other: Interest) -> Option<Interest>Remove
Interestfromself.Interests present in
otherbut not inselfare ignored.Returns
Noneif the set would be empty after removingInterest.Examples
use Interest; const RW_INTEREST: Interest = READABLE.add; let w_interest = RW_INTEREST.remove.unwrap; assert!; assert!; // Removing all interests from the set returns `None`. assert_eq!; // Remove all interests at once. assert_eq!;
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 PartialEq for Interest
fn eq(&self, other: &Interest) -> bool
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 = never;fn try_from(value: U) -> Result<T, never>
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>