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 PRIORITY: Interest = _
pub const PRIORITY: Interest = _
Returns a Interest
set representing priority completion interests.
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.
sourcepub const fn is_priority(self) -> bool
pub const fn is_priority(self) -> bool
Returns true if Interest
contains priority 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 moresourceimpl Ord for Interest
impl Ord for Interest
sourceimpl PartialOrd<Interest> for Interest
impl PartialOrd<Interest> for Interest
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
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more