跳到主要内容

Ready

搜索

结构体 Ready 

源代码
pub struct Ready(/* 私有字段 */);
展开描述

描述 I/O 资源的就绪状态。

Ready 跟踪 I/O 资源准备好执行的操作。

实现§

源代码§

impl Ready

源代码

pub const EMPTY: Ready

返回空的 Ready 集合。

源代码

pub const READABLE: Ready

返回表示可读就绪状态的 Ready

源代码

pub const WRITABLE: Ready

返回表示可写就绪状态的 Ready

源代码

pub const READ_CLOSED: Ready

返回表示读取关闭就绪状态的 Ready

源代码

pub const WRITE_CLOSED: Ready

返回表示写入关闭就绪状态的 Ready

源代码

pub const ERROR: Ready

返回表示错误就绪状态的 Ready

源代码

pub const ALL: Ready

返回表示所有操作就绪状态的 Ready

源代码

pub fn is_empty(self) -> bool

如果 Ready 是空集合,则返回 true。

§示例
use tokio::io::Ready;

assert!(Ready::EMPTY.is_empty());
assert!(!Ready::READABLE.is_empty());
源代码

pub fn is_readable(self) -> bool

如果该值包括 readable(可读),则返回 true

§示例
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());
源代码

pub fn is_writable(self) -> bool

如果该值包括可写 readiness(就绪),则返回 true

§示例
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());
源代码

pub fn is_read_closed(self) -> bool

如果该值包括读取关闭 readiness(就绪),则返回 true

§示例
use tokio::io::Ready;

assert!(!Ready::EMPTY.is_read_closed());
assert!(!Ready::READABLE.is_read_closed());
assert!(Ready::READ_CLOSED.is_read_closed());
源代码

pub fn is_write_closed(self) -> bool

如果该值包括写入关闭 readiness(就绪),则返回 true

§示例
use tokio::io::Ready;

assert!(!Ready::EMPTY.is_write_closed());
assert!(!Ready::WRITABLE.is_write_closed());
assert!(Ready::WRITE_CLOSED.is_write_closed());
源代码

pub fn is_error(self) -> bool

如果该值包括错误 readiness(就绪),则返回 true

§示例
use tokio::io::Ready;

assert!(!Ready::EMPTY.is_error());
assert!(!Ready::WRITABLE.is_error());
assert!(Ready::ERROR.is_error());

trait 实现§

源代码§

impl BitAnd for Ready

源代码§

type Output = Ready

应用 & 运算符后得到的类型。
源代码§

fn bitand(self, other: Ready) -> Ready

Performs the & operation. 更多信息
源代码§

impl BitOr for Ready

源代码§

type Output = Ready

应用 | 运算符后得到的类型。
源代码§

fn bitor(self, other: Ready) -> Ready

Performs the | operation. 更多信息
源代码§

impl BitOrAssign for Ready

源代码§

fn bitor_assign(&mut self, other: Ready)

Performs the |= operation. 更多信息
源代码§

impl Clone for Ready

源代码§

fn clone(&self) -> Ready

返回值的副本。 更多信息
1.0.0 · 源代码§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 更多信息
源代码§

impl Debug for Ready

源代码§

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

使用给定的格式化器格式化此值。 更多信息
源代码§

impl Ord for Ready

源代码§

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

This method returns an Ordering between self and other. 更多信息
1.21.0 · 源代码§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. 更多信息
1.21.0 · 源代码§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. 更多信息
1.50.0 · 源代码§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. 更多信息
源代码§

impl PartialEq for Ready

源代码§

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

测试 selfother 值是否相等,供 == 运算符使用。
1.0.0 · 源代码§

fn ne(&self, other: &Rhs) -> bool

测试 != 运算符。默认实现几乎总是够用,除非有非常充分的理由,否则不应被覆盖。
源代码§

impl PartialOrd for Ready

源代码§

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

若存在,此方法返回 selfother 值之间的排序关系。 更多信息
1.0.0 · 源代码§

fn lt(&self, other: &Rhs) -> bool

测试小于(针对 selfother),供 < 运算符使用。 更多信息
1.0.0 · 源代码§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. 更多信息
1.0.0 · 源代码§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. 更多信息
1.0.0 · 源代码§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. 更多信息
源代码§

impl Sub for Ready

源代码§

type Output = Ready

应用 - 运算符后得到的类型。
源代码§

fn sub(self, other: Ready) -> Ready

Performs the - operation. 更多信息
源代码§

impl Copy for Ready

源代码§

impl Eq for Ready

源代码§

impl StructuralPartialEq for Ready

自动 trait 实现§

§

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 实现§

源代码§

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

源代码§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
源代码§

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

源代码§

fn borrow(&self) -> &T

Immutably borrows from an owned value. 更多信息
源代码§

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

源代码§

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

Mutably borrows from an owned value. 更多信息
源代码§

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

源代码§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 更多信息
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

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

源代码§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换是 From<T> for U 实现选择执行的操作。

源代码§

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

源代码§

type Owned = T

获得所有权后的类型。
源代码§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. 更多信息
源代码§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 更多信息
源代码§

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

源代码§

type Error = Infallible

转换出错时返回的类型。
源代码§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
源代码§

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

源代码§

type Error = <U as TryFrom<T>>::Error

转换出错时返回的类型。
源代码§

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

执行转换。