Struct Ready

pub struct Ready(/* private field */);

Describes the readiness state of an I/O resources.

Ready tracks which operation an I/O resource is ready to perform.

Implementations

impl Ready

const EMPTY: Ready = _;

Returns the empty Ready set.

const READABLE: Ready = _;

Returns a Ready representing readable readiness.

const WRITABLE: Ready = _;

Returns a Ready representing writable readiness.

const READ_CLOSED: Ready = _;

Returns a Ready representing read closed readiness.

const WRITE_CLOSED: Ready = _;

Returns a Ready representing write closed readiness.

const PRIORITY: Ready = _;

Returns a Ready representing priority readiness.

const ERROR: Ready = _;

Returns a Ready representing error readiness.

const ALL: Ready = _;

Returns a Ready representing readiness for all operations.

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());
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());
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());
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());
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());
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());
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());

Trait Implementations

impl BitAnd for Ready

type Output = Ready;
fn bitand(self, other: Ready) -> Ready

impl BitOr for Ready

type Output = Ready;
fn bitor(self, other: Ready) -> Ready

impl BitOrAssign for Ready

fn bitor_assign(&mut self, other: Ready)

impl Clone for Ready

fn clone(&self) -> Self

impl Copy for Ready

impl Debug for Ready

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

impl Eq for Ready

impl Ord for Ready

fn cmp(&self, other: &Self) -> Ordering

impl PartialEq for Ready

fn eq(&self, other: &Self) -> bool

impl PartialOrd for Ready

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

impl StructuralPartialEq for Ready

impl Sub for Ready

type Output = Ready;
fn sub(self, other: Ready) -> 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 UnsafeUnpin for Ready

impl UnwindSafe for Ready

Blanket Implementations

impl<T> Any for Ready where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Ready where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Ready where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Ready where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Ready

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Ready where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Ready where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Ready where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Ready where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>