pub struct Status(/* private fields */);
Expand description
Status type indicating the result of a Fuchsia syscall.
This type is generally used to indicate the reason for an error.
While this type can contain Status::OK
(ZX_OK
in C land), elements of this type are
generally constructed using the ok
method, which checks for ZX_OK
and returns a
Result<(), Status>
appropriately.
Implementations§
Source§impl Status
impl Status
Sourcepub const INTERNAL: Status
pub const INTERNAL: Status
The system encountered an otherwise unspecified error while performing the operation.
Sourcepub const NOT_SUPPORTED: Status
pub const NOT_SUPPORTED: Status
The operation is not implemented, supported, or enabled.
Sourcepub const NO_RESOURCES: Status
pub const NO_RESOURCES: Status
The system was not able to allocate some resource needed for the operation.
Sourcepub const NO_MEMORY: Status
pub const NO_MEMORY: Status
The system was not able to allocate memory needed for the operation.
Sourcepub const INTERRUPTED_RETRY: Status
pub const INTERRUPTED_RETRY: Status
The system call was interrupted, but should be retried. This should not be seen outside of the VDSO.
Sourcepub const INVALID_ARGS: Status
pub const INVALID_ARGS: Status
An argument is invalid. For example, a null pointer when a null pointer is not permitted.
Sourcepub const BAD_HANDLE: Status
pub const BAD_HANDLE: Status
A specified handle value does not refer to a handle.
Sourcepub const WRONG_TYPE: Status
pub const WRONG_TYPE: Status
The subject of the operation is the wrong type to perform the operation.
For example: Attempting a message_read on a thread handle.
Sourcepub const BAD_SYSCALL: Status
pub const BAD_SYSCALL: Status
The specified syscall number is invalid.
Sourcepub const OUT_OF_RANGE: Status
pub const OUT_OF_RANGE: Status
An argument is outside the valid range for this operation.
Sourcepub const BUFFER_TOO_SMALL: Status
pub const BUFFER_TOO_SMALL: Status
The caller-provided buffer is too small for this operation.
Sourcepub const BAD_STATE: Status
pub const BAD_STATE: Status
The operation failed because the current state of the object does not allow it, or a precondition of the operation is not satisfied.
Sourcepub const TIMED_OUT: Status
pub const TIMED_OUT: Status
The time limit for the operation elapsed before the operation completed.
Sourcepub const SHOULD_WAIT: Status
pub const SHOULD_WAIT: Status
The operation cannot be performed currently but potentially could succeed if the caller waits for a prerequisite to be satisfied, like waiting for a handle to be readable or writable.
Example: Attempting to read from a channel that has no messages waiting but
has an open remote will return ZX_ERR_SHOULD_WAIT
. In contrast, attempting
to read from a channel that has no messages waiting and has a closed remote
end will return ZX_ERR_PEER_CLOSED
.
Sourcepub const PEER_CLOSED: Status
pub const PEER_CLOSED: Status
The operation failed because the remote end of the subject of the operation was closed.
Sourcepub const ALREADY_EXISTS: Status
pub const ALREADY_EXISTS: Status
An object with the specified identifier already exists.
Example: Attempting to create a file when a file already exists with that name.
Sourcepub const ALREADY_BOUND: Status
pub const ALREADY_BOUND: Status
The operation failed because the named entity is already owned or controlled by another entity. The operation could succeed later if the current owner releases the entity.
Sourcepub const UNAVAILABLE: Status
pub const UNAVAILABLE: Status
The subject of the operation is currently unable to perform the operation.
This is used when there’s no direct way for the caller to observe when the subject will be able to perform the operation and should thus retry.
Sourcepub const ACCESS_DENIED: Status
pub const ACCESS_DENIED: Status
The caller did not have permission to perform the specified operation.
Sourcepub const IO_REFUSED: Status
pub const IO_REFUSED: Status
The entity the I/O operation is being performed on rejected the operation.
Example: an I2C device NAK’ing a transaction or a disk controller rejecting an invalid command, or a stalled USB endpoint.
Sourcepub const IO_DATA_INTEGRITY: Status
pub const IO_DATA_INTEGRITY: Status
The data in the operation failed an integrity check and is possibly corrupted.
Example: CRC or Parity error.
Sourcepub const IO_DATA_LOSS: Status
pub const IO_DATA_LOSS: Status
The data in the operation is currently unavailable and may be permanently lost.
Example: A disk block is irrecoverably damaged.
Sourcepub const IO_NOT_PRESENT: Status
pub const IO_NOT_PRESENT: Status
The device is no longer available (has been unplugged from the system, powered down, or the driver has been unloaded).
Sourcepub const IO_OVERRUN: Status
pub const IO_OVERRUN: Status
More data was received from the device than expected.
Example: a USB “babble” error due to a device sending more data than the host queued to receive.
Sourcepub const IO_MISSED_DEADLINE: Status
pub const IO_MISSED_DEADLINE: Status
An operation did not complete within the required timeframe.
Example: A USB isochronous transfer that failed to complete due to an overrun or underrun.
Sourcepub const IO_INVALID: Status
pub const IO_INVALID: Status
The data in the operation is invalid parameter or is out of range.
Example: A USB transfer that failed to complete with TRB Error
Sourcepub const NOT_DIR: Status
pub const NOT_DIR: Status
The object is not a directory or does not support directory operations.
Example: Attempted to open a file as a directory or attempted to do directory operations on a file.
Sourcepub const FILE_BIG: Status
pub const FILE_BIG: Status
This operation would cause a file to exceed a filesystem-specific size limit.
Sourcepub const NOT_EMPTY: Status
pub const NOT_EMPTY: Status
The directory is not empty for an operation that requires it to be empty.
For example, non-recursively deleting a directory with files still in it.
Sourcepub const STOP: Status
pub const STOP: Status
An indicate to not call again.
The flow control values ZX_ERR_STOP
, ZX_ERR_NEXT
, and ZX_ERR_ASYNC
are
not errors and will never be returned by a system call or public API. They
allow callbacks to request their caller perform some other operation.
For example, a callback might be called on every event until it returns
something other than ZX_OK
. This status allows differentiation between
“stop due to an error” and “stop because work is done.”
Sourcepub const NEXT: Status
pub const NEXT: Status
Advance to the next item.
The flow control values ZX_ERR_STOP
, ZX_ERR_NEXT
, and ZX_ERR_ASYNC
are
not errors and will never be returned by a system call or public API. They
allow callbacks to request their caller perform some other operation.
For example, a callback could use this value to indicate it did not consume an item passed to it, but by choice, not due to an error condition.
Sourcepub const ASYNC: Status
pub const ASYNC: Status
Ownership of the item has moved to an asynchronous worker.
The flow control values ZX_ERR_STOP
, ZX_ERR_NEXT
, and ZX_ERR_ASYNC
are
not errors and will never be returned by a system call or public API. They
allow callbacks to request their caller perform some other operation.
Unlike ZX_ERR_STOP
, which implies that iteration on an object
should stop, and ZX_ERR_NEXT
, which implies that iteration
should continue to the next item, ZX_ERR_ASYNC
implies
that an asynchronous worker is responsible for continuing iteration.
For example, a callback will be called on every event, but one event needs
to handle some work asynchronously before it can continue. ZX_ERR_ASYNC
implies the worker is responsible for resuming iteration once its work has
completed.
Sourcepub const PROTOCOL_NOT_SUPPORTED: Status
pub const PROTOCOL_NOT_SUPPORTED: Status
The specified protocol is not supported.
Sourcepub const ADDRESS_UNREACHABLE: Status
pub const ADDRESS_UNREACHABLE: Status
The host is unreachable.
Sourcepub const ADDRESS_IN_USE: Status
pub const ADDRESS_IN_USE: Status
Address is being used by someone else.
Sourcepub const NOT_CONNECTED: Status
pub const NOT_CONNECTED: Status
The socket is not connected.
Sourcepub const CONNECTION_REFUSED: Status
pub const CONNECTION_REFUSED: Status
The remote peer rejected the connection.
Sourcepub const CONNECTION_RESET: Status
pub const CONNECTION_RESET: Status
The connection was reset.
Sourcepub const CONNECTION_ABORTED: Status
pub const CONNECTION_ABORTED: Status
The connection was aborted.