Struct r_efi::base::Status

source ·
#[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

source

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.

source

pub const LOAD_ERROR: Status = _

source

pub const INVALID_PARAMETER: Status = _

source

pub const UNSUPPORTED: Status = _

source

pub const BAD_BUFFER_SIZE: Status = _

source

pub const BUFFER_TOO_SMALL: Status = _

source

pub const NOT_READY: Status = _

source

pub const DEVICE_ERROR: Status = _

source

pub const WRITE_PROTECTED: Status = _

source

pub const OUT_OF_RESOURCES: Status = _

source

pub const VOLUME_CORRUPTED: Status = _

source

pub const VOLUME_FULL: Status = _

source

pub const NO_MEDIA: Status = _

source

pub const MEDIA_CHANGED: Status = _

source

pub const NOT_FOUND: Status = _

source

pub const ACCESS_DENIED: Status = _

source

pub const NO_RESPONSE: Status = _

source

pub const NO_MAPPING: Status = _

source

pub const TIMEOUT: Status = _

source

pub const NOT_STARTED: Status = _

source

pub const ALREADY_STARTED: Status = _

source

pub const ABORTED: Status = _

source

pub const ICMP_ERROR: Status = _

source

pub const TFTP_ERROR: Status = _

source

pub const PROTOCOL_ERROR: Status = _

source

pub const INCOMPATIBLE_VERSION: Status = _

source

pub const SECURITY_VIOLATION: Status = _

source

pub const CRC_ERROR: Status = _

source

pub const END_OF_MEDIA: Status = _

source

pub const END_OF_FILE: Status = _

source

pub const INVALID_LANGUAGE: Status = _

source

pub const COMPROMISED_DATA: Status = _

source

pub const IP_ADDRESS_CONFLICT: Status = _

source

pub const HTTP_ERROR: Status = _

source

pub const NETWORK_UNREACHABLE: Status = _

source

pub const HOST_UNREACHABLE: Status = _

source

pub const PROTOCOL_UNREACHABLE: Status = _

source

pub const PORT_UNREACHABLE: Status = _

source

pub const CONNECTION_FIN: Status = _

source

pub const CONNECTION_RESET: Status = _

source

pub const CONNECTION_REFUSED: Status = _

source

pub const WARN_UNKNOWN_GLYPH: Status = _

source

pub const WARN_DELETE_FAILURE: Status = _

source

pub const WARN_WRITE_FAILURE: Status = _

source

pub const WARN_BUFFER_TOO_SMALL: Status = _

source

pub const WARN_STALE_DATA: Status = _

source

pub const WARN_FILE_SYSTEM: Status = _

source

pub const WARN_RESET_REQUIRED: Status = _

source

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.

source

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.

source

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.

source

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 Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Status

source§

fn default() -> Status

Returns the “default value” for a type. Read more
source§

impl From<Status> for Result<Status, Status>

source§

fn from(status: Status) -> Self

Converts to this type from the input type.
source§

impl Hash for Status

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Status

source§

fn cmp(&self, other: &Status) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Status

source§

fn eq(&self, other: &Status) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

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

impl PartialOrd for Status

source§

fn partial_cmp(&self, other: &Status) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Status

source§

impl Eq for Status

source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.