#[repr(C)]pub struct Status(/* private fields */);
Expand description
Status Codes
UEFI uses the Status
type to represent all kinds of status codes. This includes return codes
from functions, but also complex state of different devices and drivers. It is a simple
usize
, but wrapped in a rust-type to allow us to implement helpers on this type. Depending
on the context, different state is stored in it. Note that it is always binary compatible to a
usize!
Implementations§
Source§impl Status
impl Status
Sourcepub const SUCCESS: Status
pub const SUCCESS: Status
Success Code
This code represents a successfull function invocation. Its value is guaranteed to be 0. However, note that warnings are considered success as well, so this is not the only code that can be returned by UEFI functions on success. However, in nearly all situations warnings are not allowed, so the effective result will be SUCCESS.
pub const LOAD_ERROR: Status
pub const INVALID_PARAMETER: Status
pub const UNSUPPORTED: Status
pub const BAD_BUFFER_SIZE: Status
pub const BUFFER_TOO_SMALL: Status
pub const NOT_READY: Status
pub const DEVICE_ERROR: Status
pub const WRITE_PROTECTED: Status
pub const OUT_OF_RESOURCES: Status
pub const VOLUME_CORRUPTED: Status
pub const VOLUME_FULL: Status
pub const NO_MEDIA: Status
pub const MEDIA_CHANGED: Status
pub const NOT_FOUND: Status
pub const ACCESS_DENIED: Status
pub const NO_RESPONSE: Status
pub const NO_MAPPING: Status
pub const TIMEOUT: Status
pub const NOT_STARTED: Status
pub const ALREADY_STARTED: Status
pub const ABORTED: Status
pub const ICMP_ERROR: Status
pub const TFTP_ERROR: Status
pub const PROTOCOL_ERROR: Status
pub const INCOMPATIBLE_VERSION: Status
pub const SECURITY_VIOLATION: Status
pub const CRC_ERROR: Status
pub const END_OF_MEDIA: Status
pub const END_OF_FILE: Status
pub const INVALID_LANGUAGE: Status
pub const COMPROMISED_DATA: Status
pub const IP_ADDRESS_CONFLICT: Status
pub const HTTP_ERROR: Status
pub const NETWORK_UNREACHABLE: Status
pub const HOST_UNREACHABLE: Status
pub const PROTOCOL_UNREACHABLE: Status
pub const PORT_UNREACHABLE: Status
pub const CONNECTION_FIN: Status
pub const CONNECTION_RESET: Status
pub const CONNECTION_REFUSED: Status
pub const WARN_UNKNOWN_GLYPH: Status
pub const WARN_DELETE_FAILURE: Status
pub const WARN_WRITE_FAILURE: Status
pub const WARN_BUFFER_TOO_SMALL: Status
pub const WARN_STALE_DATA: Status
pub const WARN_FILE_SYSTEM: Status
pub const WARN_RESET_REQUIRED: Status
Sourcepub const fn from_usize(v: usize) -> Status
pub const fn from_usize(v: usize) -> Status
Create Status Code from Integer
This takes the literal value of a status code and turns it into a Status
object. Note
that we want it as const fn
so we cannot use core::convert::From
.
Sourcepub const fn as_usize(&self) -> usize
pub const fn as_usize(&self) -> usize
Return Underlying Integer Representation
This takes the Status
object and returns the underlying integer representation as
defined by the UEFI specification.
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Check whether this is an error
This returns true if the given status code is considered an error. Errors mean the operation did not succeed, nor produce any valuable output. Output parameters must be considered invalid if an error was returned. That is, its content is not well defined.
Sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
Check whether this is a warning
This returns true if the given status code is considered a warning. Warnings are to be treated as success, but might indicate data loss or other device errors. However, if an operation returns with a warning code, it must be considered successfull, and the output parameters are valid.