pub struct Interest(_);
Expand description
Interest used in registering.
Interest are used in registering event::Source
s 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
sourceimpl Interest
impl Interest
sourcepub const fn add(self, other: Interest) -> Interest
pub const fn add(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);
sourcepub fn remove(self, other: Interest) -> Option<Interest>
pub fn remove(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);
sourcepub const fn is_readable(self) -> bool
pub const fn is_readable(self) -> bool
Returns true if the value includes readable readiness.
sourcepub const fn is_writable(self) -> bool
pub const fn is_writable(self) -> bool
Returns true if the value includes writable readiness.
Trait Implementations
sourceimpl BitOrAssign<Interest> for Interest
impl BitOrAssign<Interest> for Interest
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the |=
operation. Read more
sourceimpl Ord for Interest
impl Ord for Interest
sourceimpl PartialOrd<Interest> for Interest
impl PartialOrd<Interest> for Interest
sourcefn partial_cmp(&self, other: &Interest) -> Option<Ordering>
fn partial_cmp(&self, other: &Interest) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Interest
impl Eq for Interest
impl StructuralEq for Interest
impl StructuralPartialEq for Interest
Auto Trait Implementations
impl RefUnwindSafe for Interest
impl Send for Interest
impl Sync for Interest
impl Unpin for Interest
impl UnwindSafe for Interest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more