pub struct Ready(/* private fields */);
Expand description
Describes the readiness state of an I/O resources.
Ready
tracks which operation an I/O resource is ready to perform.
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.
Sourcepub const PRIORITY: Ready
Available on Linux or Android only.
pub const PRIORITY: Ready
Returns a Ready
representing priority readiness.
Sourcepub const ALL: Ready
Available on Linux or Android only.
pub const ALL: Ready
Returns a Ready
representing readiness for all operations.
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
Available on Linux or Android only.
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());
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)
Performs the
|=
operation. Read moreSource§impl Ord for Ready
impl Ord for Ready
Source§impl PartialOrd for Ready
impl PartialOrd for Ready
impl Copy for Ready
impl Eq for Ready
impl StructuralPartialEq for Ready
Auto Trait Implementations§
impl Freeze for Ready
impl RefUnwindSafe for Ready
impl Send for Ready
impl Sync for Ready
impl Unpin for Ready
impl UnwindSafe for Ready
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.