pub enum WaitResult {
Ok(Signals),
TimedOut(Signals),
Canceled(Signals),
Err(Status),
}
Expand description
Result from HandleRef::wait
and AsHandleRef::wait_handle
. Conveys the
result of the
zx_object_wait_one
syscall and the signals that were asserted on the object when the syscall
completed.
Variants§
Ok(Signals)
The syscall completed with ZX_OK
and the provided signals were observed.
TimedOut(Signals)
The syscall completed with ZX_ERR_TIMED_OUT
and the provided signals
were observed. These signals may reflect state changes that occurred
after the deadline passed, but before the syscall returned.
Canceled(Signals)
The syscall completed with ZX_ERR_CANCELED
and the provided signals
were observed. The signals will include ZX_SIGNAL_HANDLE_CLOSED
.
Note that the state of these signals may be racy and difficult to interpret. Often, the correct behavior in this case is to treat this as an error.
Err(Status)
The syscall completed with a status other than ZX_OK
, ZX_ERR_TIMED_OUT
,
or ZX_ERR_CANCELED
. No signals are returned in this scenario.
Implementations§
Source§impl WaitResult
impl WaitResult
Sourcepub const fn to_result(self) -> Result<Signals, Status>
pub const fn to_result(self) -> Result<Signals, Status>
Convert this WaitResult
into a Result<Signals, Status>
. The signals
are discarded in all cases except WaitResult::Ok
.
pub const fn is_ok(&self) -> bool
pub const fn is_err(&self) -> bool
pub fn map<U, F>(self, op: F) -> Result<U, Status>
pub fn map_err<F, O>(self, op: O) -> Result<Signals, F>
pub fn expect(self, msg: &str) -> Signals
pub fn expect_err(self, msg: &str) -> Status
pub fn unwrap(self) -> Signals
Trait Implementations§
Source§impl Clone for WaitResult
impl Clone for WaitResult
Source§fn clone(&self) -> WaitResult
fn clone(&self) -> WaitResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more