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 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());
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 PartialEq for Ready
impl PartialEq for Ready
source§impl PartialOrd for Ready
impl PartialOrd for Ready
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 Ready
impl Eq for Ready
impl StructuralEq for Ready
impl StructuralPartialEq for Ready
Auto Trait Implementations§
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