pub struct Ready(usize);
Expand description
Describes the readiness state of an I/O resources.
Ready
tracks which operation an I/O resource is ready to perform.
Tuple Fields§
§0: usize
Implementations§
Source§impl Ready
impl Ready
Sourcepub const READ_CLOSED: Ready
pub const READ_CLOSED: Ready
Returns a Ready
representing read closed readiness.
Sourcepub const WRITE_CLOSED: Ready
pub const WRITE_CLOSED: Ready
Returns a Ready
representing write closed readiness.
pub(crate) fn from_mio(event: &Event) -> Ready
Sourcepub fn is_empty(self) -> bool
pub fn is_empty(self) -> bool
Returns true if Ready
is the empty set.
§Examples
use tokio::io::Ready;
assert!(Ready::EMPTY.is_empty());
assert!(!Ready::READABLE.is_empty());
Sourcepub fn is_readable(self) -> bool
pub fn is_readable(self) -> bool
Returns true
if the value includes readable
.
§Examples
use tokio::io::Ready;
assert!(!Ready::EMPTY.is_readable());
assert!(Ready::READABLE.is_readable());
assert!(Ready::READ_CLOSED.is_readable());
assert!(!Ready::WRITABLE.is_readable());
Sourcepub fn is_writable(self) -> bool
pub fn is_writable(self) -> bool
Returns true
if the value includes writable readiness
.
§Examples
use tokio::io::Ready;
assert!(!Ready::EMPTY.is_writable());
assert!(!Ready::READABLE.is_writable());
assert!(Ready::WRITABLE.is_writable());
assert!(Ready::WRITE_CLOSED.is_writable());
Sourcepub fn is_read_closed(self) -> bool
pub fn is_read_closed(self) -> bool
Returns true
if the value includes read-closed readiness
.
§Examples
use tokio::io::Ready;
assert!(!Ready::EMPTY.is_read_closed());
assert!(!Ready::READABLE.is_read_closed());
assert!(Ready::READ_CLOSED.is_read_closed());
Sourcepub fn is_write_closed(self) -> bool
pub fn is_write_closed(self) -> bool
Returns true
if the value includes write-closed readiness
.
§Examples
use tokio::io::Ready;
assert!(!Ready::EMPTY.is_write_closed());
assert!(!Ready::WRITABLE.is_write_closed());
assert!(Ready::WRITE_CLOSED.is_write_closed());
Sourcepub fn is_priority(self) -> bool
pub fn is_priority(self) -> bool
Returns true
if the value includes priority readiness
.
§Examples
use tokio::io::Ready;
assert!(!Ready::EMPTY.is_priority());
assert!(!Ready::WRITABLE.is_priority());
assert!(Ready::PRIORITY.is_priority());
Sourcepub fn is_error(self) -> bool
pub fn is_error(self) -> bool
Returns true
if the value includes error readiness
.
§Examples
use tokio::io::Ready;
assert!(!Ready::EMPTY.is_error());
assert!(!Ready::WRITABLE.is_error());
assert!(Ready::ERROR.is_error());
Sourcepub(crate) fn contains<T: Into<Self>>(self, other: T) -> bool
pub(crate) fn contains<T: Into<Self>>(self, other: T) -> bool
Returns true if self
is a superset of other
.
other
may represent more than one readiness operations, in which case
the function only returns true if self
contains all readiness
specified in other
.
Sourcepub(crate) fn from_usize(val: usize) -> Ready
pub(crate) fn from_usize(val: usize) -> Ready
Creates a Ready
instance using the given usize
representation.
The usize
representation must have been obtained from a call to
Readiness::as_usize
.
This function is mainly provided to allow the caller to get a
readiness value from an AtomicUsize
.
Sourcepub(crate) fn as_usize(self) -> usize
pub(crate) fn as_usize(self) -> usize
Returns a usize
representation of the Ready
value.
This function is mainly provided to allow the caller to store a
readiness value in an AtomicUsize
.
pub(crate) fn from_interest(interest: Interest) -> Ready
pub(crate) fn intersection(self, interest: Interest) -> Ready
pub(crate) fn satisfies(self, interest: Interest) -> bool
Trait Implementations§
Source§impl BitOrAssign for Ready
impl BitOrAssign for Ready
Source§fn bitor_assign(&mut self, other: Ready)
fn bitor_assign(&mut self, other: Ready)
|=
operation. Read more