#[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.
Trait Implementations§
source§impl Ord for Status
impl Ord for Status
source§impl PartialEq for Status
impl PartialEq for Status
source§impl PartialOrd for Status
impl PartialOrd for Status
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more