#[repr(u8)]pub enum IoState {
Idle = 0,
Submitted = 1,
InProgress = 2,
Completed = 3,
Cancelled = 4,
Failed = 5,
}Expand description
I/O operation state machine I/O操作状态机
Tracks the lifecycle of an I/O operation from submission to completion. 跟踪I/O操作从提交到完成的生命周期。
Variants§
Idle = 0
Operation is idle, not yet submitted / 操作空闲,尚未提交
Submitted = 1
Operation has been submitted to kernel / 操作已提交给内核
InProgress = 2
Operation is in progress / 操作进行中
Completed = 3
Operation completed successfully / 操作成功完成
Cancelled = 4
Operation was cancelled / 操作被取消
Failed = 5
Operation failed / 操作失败
Implementations§
Source§impl IoState
impl IoState
Sourcepub const fn is_finished(self) -> bool
pub const fn is_finished(self) -> bool
Check if the operation is finished (completed, cancelled, or failed) 检查操作是否已完成(成功、取消或失败)
Sourcepub const fn is_in_progress(self) -> bool
pub const fn is_in_progress(self) -> bool
Check if the operation is in progress (submitted or in progress) 检查操作是否进行中(已提交或进行中)
Sourcepub fn is_success(self) -> bool
pub fn is_success(self) -> bool
Check if the operation succeeded 检查操作是否成功
Trait Implementations§
impl Copy for IoState
impl Eq for IoState
impl StructuralPartialEq for IoState
Auto Trait Implementations§
impl Freeze for IoState
impl RefUnwindSafe for IoState
impl Send for IoState
impl Sync for IoState
impl Unpin for IoState
impl UnsafeUnpin for IoState
impl UnwindSafe for IoState
Blanket Implementations§
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. Read more