pub struct Ready(/* private fields */);展开描述
描述 I/O 资源的就绪状态。
Ready 用于跟踪 I/O 资源已就绪可执行的操作。
实现§
Source§impl Ready
impl Ready
Sourcepub const READ_CLOSED: Ready
pub const READ_CLOSED: Ready
返回表示读关闭就绪的 Ready。
Sourcepub const WRITE_CLOSED: Ready
pub const WRITE_CLOSED: Ready
返回表示写关闭就绪的 Ready。
Sourcepub 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());Sourcepub 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());Sourcepub fn is_writable(self) -> bool
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());Sourcepub fn is_read_closed(self) -> bool
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());Sourcepub fn is_write_closed(self) -> bool
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());Trait 实现§
Source§impl BitOrAssign for Ready
impl BitOrAssign for Ready
Source§fn bitor_assign(&mut self, other: Ready)
fn bitor_assign(&mut self, other: Ready)
Performs the
|= operation. 更多信息Source§impl Ord for Ready
impl Ord for Ready
Source§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 实现§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 更多信息