pub struct PollOpt(/* private fields */);
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 corcovado::PollOpt;
let opts = PollOpt::edge() | PollOpt::oneshot();
assert!(opts.is_edge());
assert!(opts.is_oneshot());
assert!(!opts.is_level());
Implementations§
source§impl PollOpt
impl PollOpt
pub fn urgent() -> PollOpt
pub fn all() -> PollOpt
sourcepub fn is_oneshot(&self) -> bool
pub fn is_oneshot(&self) -> bool
pub fn is_urgent(&self) -> bool
pub fn bits(&self) -> usize
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 corcovado::PollOpt;
let opt = PollOpt::oneshot();
assert!(opt.contains(PollOpt::oneshot()));
assert!(!opt.contains(PollOpt::edge()));
use corcovado::PollOpt;
let opt = PollOpt::oneshot() | PollOpt::edge();
assert!(opt.contains(PollOpt::oneshot()));
assert!(opt.contains(PollOpt::edge()));
use corcovado::PollOpt;
let opt = PollOpt::oneshot() | PollOpt::edge();
assert!(!PollOpt::oneshot().contains(opt));
assert!(opt.contains(opt));
assert!((opt | PollOpt::level()).contains(opt));
Trait Implementations§
source§impl Ord for PollOpt
impl Ord for PollOpt
source§impl PartialEq for PollOpt
impl PartialEq for PollOpt
source§impl PartialOrd for PollOpt
impl PartialOrd for PollOpt
1.0.0 · source§fn 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 moreimpl Copy for PollOpt
impl Eq for PollOpt
impl StructuralPartialEq for PollOpt
Auto Trait Implementations§
impl Freeze for PollOpt
impl RefUnwindSafe for PollOpt
impl Send for PollOpt
impl Sync for PollOpt
impl Unpin for PollOpt
impl UnwindSafe for PollOpt
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more