pub struct Ready(/* 私有字段 */);展开描述
描述 I/O 资源的就绪状态。
Ready 跟踪 I/O 资源准备好执行的操作。
实现§
源代码§impl Ready
impl Ready
源代码pub const READ_CLOSED: Ready
pub const READ_CLOSED: Ready
返回表示读取关闭就绪状态的 Ready。
源代码pub const WRITE_CLOSED: Ready
pub const WRITE_CLOSED: Ready
返回表示写入关闭就绪状态的 Ready。
源代码pub fn is_empty(self) -> bool
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
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
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
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
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());trait 实现§
源代码§impl BitOrAssign for Ready
impl BitOrAssign for Ready
源代码§fn bitor_assign(&mut self, other: Ready)
fn bitor_assign(&mut self, other: Ready)
Performs the
|= operation. 更多信息源代码§impl Ord for Ready
impl Ord for Ready
源代码§impl PartialOrd for Ready
impl PartialOrd for Ready
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
源代码§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 更多信息