pub struct PollOpt(_);
Expand description
Options supplied when registering an Evented
handle with Poll
PollOpt
values can be combined together using the various bitwise
operators.
For high level documentation on polling and poll options, see Poll
.
Examples
use mio::PollOpt;
let opts = PollOpt::edge() | PollOpt::oneshot();
assert!(opts.is_edge());
assert!(opts.is_oneshot());
assert!(!opts.is_level());
Implementations
sourceimpl PollOpt
impl PollOpt
sourcepub fn is_oneshot(&self) -> bool
pub fn is_oneshot(&self) -> bool
sourcepub fn contains(&self, other: PollOpt) -> bool
pub fn contains(&self, other: PollOpt) -> bool
Returns true if self
is a superset of other
.
other
may represent more than one option, in which case the function
only returns true if self
contains all of the options specified in
other
.
See Poll
for more documentation on polling.
Examples
use mio::PollOpt;
let opt = PollOpt::oneshot();
assert!(opt.contains(PollOpt::oneshot()));
assert!(!opt.contains(PollOpt::edge()));
use mio::PollOpt;
let opt = PollOpt::oneshot() | PollOpt::edge();
assert!(opt.contains(PollOpt::oneshot()));
assert!(opt.contains(PollOpt::edge()));
use mio::PollOpt;
let opt = PollOpt::oneshot() | PollOpt::edge();
assert!(!PollOpt::oneshot().contains(opt));
assert!(opt.contains(opt));
assert!((opt | PollOpt::level()).contains(opt));
Trait Implementations
sourceimpl Ord for PollOpt
impl Ord for PollOpt
sourceimpl PartialOrd<PollOpt> for PollOpt
impl PartialOrd<PollOpt> for PollOpt
sourcefn partial_cmp(&self, other: &PollOpt) -> Option<Ordering>
fn partial_cmp(&self, other: &PollOpt) -> 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 PollOpt
impl Eq for PollOpt
impl StructuralEq for PollOpt
impl StructuralPartialEq for PollOpt
Auto Trait Implementations
impl RefUnwindSafe for PollOpt
impl Send for PollOpt
impl Sync for PollOpt
impl Unpin for PollOpt
impl UnwindSafe for PollOpt
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