跳到主要内容

Ready

搜索

结构体 Ready 

Source
pub struct Ready(/* private fields */);
展开描述

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

Ready 用于跟踪 I/O 资源已就绪可执行的操作。

实现§

Source§

impl Ready

Source

pub const EMPTY: Ready

返回空的 Ready 集合。

Source

pub const READABLE: Ready

返回表示可读就绪的 Ready

Source

pub const WRITABLE: Ready

返回表示可写就绪的 Ready

Source

pub const READ_CLOSED: Ready

返回表示读关闭就绪的 Ready

Source

pub const WRITE_CLOSED: Ready

返回表示写关闭就绪的 Ready

Source

pub const ERROR: Ready

返回表示错误就绪的 Ready

Source

pub const ALL: Ready

返回表示对所有操作都就绪的 Ready

Source

pub fn is_empty(self) -> bool

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

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

assert!(Ready::EMPTY.is_empty());
assert!(!Ready::READABLE.is_empty());
Source

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

pub fn is_writable(self) -> bool

如果该值包含 writable 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());
Source

pub fn is_read_closed(self) -> bool

如果该值包含 read-closed 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());
Source

pub fn is_write_closed(self) -> bool

如果该值包含 write-closed 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());
Source

pub fn is_error(self) -> bool

如果该值包含 error readiness,则返回 true

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

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

Trait 实现§

Source§

impl BitAnd for Ready

Source§

type Output = Ready

应用 & 运算符后得到的类型。
Source§

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

Performs the & operation. 更多信息
Source§

impl BitOr for Ready

Source§

type Output = Ready

应用 | 运算符后得到的类型。
Source§

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

Performs the | operation. 更多信息
Source§

impl BitOrAssign for Ready

Source§

fn bitor_assign(&mut self, other: Ready)

Performs the |= operation. 更多信息
Source§

impl Clone for Ready

Source§

fn clone(&self) -> Ready

返回值的副本。 更多信息
1.0.0 · Source§

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

Performs copy-assignment from source. 更多信息
Source§

impl Debug for Ready

Source§

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

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

impl Ord for Ready

Source§

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

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

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

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

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

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

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

Restrict a value to a certain interval. 更多信息
Source§

impl PartialEq for Ready

Source§

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

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

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

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

impl PartialOrd for Ready

Source§

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

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

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

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

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 · Source§

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

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

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

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

impl Sub for Ready

Source§

type Output = Ready

应用 - 运算符后得到的类型。
Source§

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

Performs the - operation. 更多信息
Source§

impl Copy for Ready

Source§

impl Eq for Ready

Source§

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

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. 更多信息
Source§

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

Source§

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

Mutably borrows from an owned value. 更多信息
Source§

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

Source§

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. 更多信息
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回传入的参数。

Source§

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

Source§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换的具体行为取决于 From<T> for U 的实现方式。

Source§

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

Source§

type Owned = T

获得所有权后的类型。
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. 更多信息
Source§

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

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

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

Source§

type Error = Infallible

转换出错时返回的类型。
Source§

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

执行转换。
Source§

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

Source§

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

转换出错时返回的类型。
Source§

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

执行转换。