#[repr(C)]
pub struct Status(_);
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

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.

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.

Return Underlying Integer Representation

This takes the Status object and returns the underlying integer representation as defined by the UEFI specification.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.