pub struct Ready(_);
Expand description
Describes the readiness state of an I/O resources.
Ready
tracks which operation an I/O resource is ready to perform.
Implementations
sourceimpl Ready
impl Ready
sourcepub const READ_CLOSED: Ready = Ready(READ_CLOSED)
pub const READ_CLOSED: Ready = Ready(READ_CLOSED)
Returns a Ready
representing read closed readiness.
sourcepub const WRITE_CLOSED: Ready = Ready(WRITE_CLOSED)
pub const WRITE_CLOSED: Ready = Ready(WRITE_CLOSED)
Returns a Ready
representing write closed readiness.
sourcepub const ALL: Ready = Ready(READABLE | WRITABLE | READ_CLOSED | WRITE_CLOSED)
pub const ALL: Ready = Ready(READABLE | WRITABLE | READ_CLOSED | WRITE_CLOSED)
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());
Trait Implementations
sourceimpl BitOrAssign<Ready> for Ready
impl BitOrAssign<Ready> for Ready
sourcefn bitor_assign(&mut self, other: Ready)
fn bitor_assign(&mut self, other: Ready)
Performs the |=
operation. Read more
sourceimpl PartialOrd<Ready> for Ready
impl PartialOrd<Ready> for Ready
sourcefn partial_cmp(&self, other: &Ready) -> Option<Ordering>
fn partial_cmp(&self, other: &Ready) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more