Struct Interest

struct Interest(_)

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 fn add(self: Self, other: Interest) -> Interest

Add together two Interest.

This does the same thing as the BitOr implementation, but is a constant function.

use mio::Interest;

const INTERESTS: Interest = Interest::READABLE.add(Interest::WRITABLE);
# fn silent_dead_code_warning(_: Interest) { }
# silent_dead_code_warning(INTERESTS)
fn remove(self: Self, other: Interest) -> Option<Interest>

Removes other Interest from self.

Returns None if the set would be empty after removing other.

use mio::Interest;

const RW_INTERESTS: Interest = Interest::READABLE.add(Interest::WRITABLE);

// As long a one interest remain this will return `Some`.
let w_interest = RW_INTERESTS.remove(Interest::READABLE).unwrap();
assert!(!w_interest.is_readable());
assert!(w_interest.is_writable());

// Removing all interests from the set will return `None`.
assert_eq!(w_interest.remove(Interest::WRITABLE), None);

// Its also possible to remove multiple interests at once.
assert_eq!(RW_INTERESTS.remove(RW_INTERESTS), None);
const fn is_readable(self: Self) -> bool

Returns true if the value includes readable readiness.

const fn is_writable(self: Self) -> bool

Returns true if the value includes writable readiness.

const fn is_aio(self: Self) -> bool

Returns true if Interest contains AIO readiness.

const fn is_lio(self: Self) -> bool

Returns true if Interest contains LIO readiness.

const fn is_priority(self: Self) -> bool

Returns true if Interest contains priority readiness.

impl BitOr for Interest

fn bitor(self: Self, other: Self) -> Self

impl BitOrAssign for Interest

fn bitor_assign(self: &mut Self, other: Self)

impl Clone for Interest

fn clone(self: &Self) -> Interest

impl Copy for Interest

impl Debug for Interest

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

impl Eq for Interest

impl Freeze for Interest

impl Ord for Interest

fn cmp(self: &Self, other: &Interest) -> Ordering

impl PartialEq for Interest

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

impl PartialOrd for Interest

fn partial_cmp(self: &Self, other: &Interest) -> Option<Ordering>

impl RefUnwindSafe for Interest

impl Send for Interest

impl StructuralPartialEq for Interest

impl Sync for Interest

impl Unpin for Interest

impl UnsafeUnpin for Interest

impl UnwindSafe for Interest

impl<T> Any for Interest

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Interest

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Interest

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

impl<T> CloneToUninit for Interest

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

impl<T> From for Interest

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Interest

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Interest

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Interest

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

impl<T, U> TryInto for Interest

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