Struct mio::PollOpt [−][src]
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
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));
Adds all options represented by other
into self
.
This is equivalent to *self = *self | other
.
Examples
use mio::PollOpt;
let mut opt = PollOpt::empty();
opt.insert(PollOpt::oneshot());
assert!(opt.is_oneshot());
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for PollOpt
impl UnwindSafe for PollOpt
Blanket Implementations
Mutably borrows from an owned value. Read more