Struct uefi::Status[][src]

#[must_use]
#[repr(transparent)]
pub struct Status(pub usize);

UEFI uses status codes in order to report successes, errors, and warnings.

Unfortunately, the spec allows and encourages implementation-specific non-portable status codes. Therefore, these cannot be modeled as a Rust enum, as injecting an unknown value in a Rust enum is undefined behaviour.

For lack of a better option, we therefore model them as a newtype of usize.

Implementations

impl Status[src]

pub const SUCCESS: Status[src]

The operation completed successfully.

pub const WARN_UNKNOWN_GLYPH: Status[src]

The string contained characters that could not be rendered and were skipped.

pub const WARN_DELETE_FAILURE: Status[src]

The handle was closed, but the file was not deleted.

pub const WARN_WRITE_FAILURE: Status[src]

The handle was closed, but the data to the file was not flushed properly.

pub const WARN_BUFFER_TOO_SMALL: Status[src]

The resulting buffer was too small, and the data was truncated.

pub const WARN_STALE_DATA: Status[src]

The data has not been updated within the timeframe set by local policy.

pub const WARN_FILE_SYSTEM: Status[src]

The resulting buffer contains UEFI-compliant file system.

pub const WARN_RESET_REQUIRED: Status[src]

The operation will be processed across a system reset.

pub const LOAD_ERROR: Status[src]

The image failed to load.

pub const INVALID_PARAMETER: Status[src]

A parameter was incorrect.

pub const UNSUPPORTED: Status[src]

The operation is not supported.

pub const BAD_BUFFER_SIZE: Status[src]

The buffer was not the proper size for the request.

pub const BUFFER_TOO_SMALL: Status[src]

The buffer is not large enough to hold the requested data. The required buffer size is returned in the appropriate parameter.

pub const NOT_READY: Status[src]

There is no data pending upon return.

pub const DEVICE_ERROR: Status[src]

The physical device reported an error while attempting the operation.

pub const WRITE_PROTECTED: Status[src]

The device cannot be written to.

pub const OUT_OF_RESOURCES: Status[src]

A resource has run out.

pub const VOLUME_CORRUPTED: Status[src]

An inconstency was detected on the file system.

pub const VOLUME_FULL: Status[src]

There is no more space on the file system.

pub const NO_MEDIA: Status[src]

The device does not contain any medium to perform the operation.

pub const MEDIA_CHANGED: Status[src]

The medium in the device has changed since the last access.

pub const NOT_FOUND: Status[src]

The item was not found.

pub const ACCESS_DENIED: Status[src]

Access was denied.

pub const NO_RESPONSE: Status[src]

The server was not found or did not respond to the request.

pub const NO_MAPPING: Status[src]

A mapping to a device does not exist.

pub const TIMEOUT: Status[src]

The timeout time expired.

pub const NOT_STARTED: Status[src]

The protocol has not been started.

pub const ALREADY_STARTED: Status[src]

The protocol has already been started.

pub const ABORTED: Status[src]

The operation was aborted.

pub const ICMP_ERROR: Status[src]

An ICMP error occurred during the network operation.

pub const TFTP_ERROR: Status[src]

A TFTP error occurred during the network operation.

pub const PROTOCOL_ERROR: Status[src]

A protocol error occurred during the network operation.

pub const INCOMPATIBLE_VERSION: Status[src]

The function encountered an internal version that was incompatible with a version requested by the caller.

pub const SECURITY_VIOLATION: Status[src]

The function was not performed due to a security violation.

pub const CRC_ERROR: Status[src]

A CRC error was detected.

pub const END_OF_MEDIA: Status[src]

Beginning or end of media was reached

pub const END_OF_FILE: Status[src]

The end of the file was reached.

pub const INVALID_LANGUAGE: Status[src]

The language specified was invalid.

pub const COMPROMISED_DATA: Status[src]

The security status of the data is unknown or compromised and the data must be updated or replaced to restore a valid security status.

pub const IP_ADDRESS_CONFLICT: Status[src]

There is an address conflict address allocation

pub const HTTP_ERROR: Status[src]

A HTTP error occurred during the network operation.

impl Status[src]

pub fn is_success(self) -> bool[src]

Returns true if status code indicates success.

pub fn is_warning(self) -> bool[src]

Returns true if status code indicates a warning.

pub fn is_error(self) -> bool[src]

Returns true if the status code indicates an error.

pub fn into_with_val<T>(self, val: impl FnOnce() -> T) -> Result<T, ()>[src]

Converts this status code into a result with a given value.

pub fn into_with_err<ErrData: Debug>(
    self,
    err: impl FnOnce(Status) -> ErrData
) -> Result<(), ErrData>
[src]

Converts this status code into a result with a given error payload

pub fn into_with<T, ErrData: Debug>(
    self,
    val: impl FnOnce() -> T,
    err: impl FnOnce(Status) -> ErrData
) -> Result<T, ErrData>
[src]

Convert this status code into a result with a given value and error payload

Trait Implementations

impl Clone for Status[src]

fn clone(&self) -> Status[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Status[src]

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

Formats the value using the given formatter. Read more

impl From<Error> for Status[src]

fn from(other: Error) -> Self[src]

Performs the conversion.

impl From<Status> for Completion<()>[src]

fn from(status: Status) -> Self[src]

Performs the conversion.

impl From<Status> for Result<(), ()>[src]

fn from(status: Status) -> Result<(), ()>[src]

Performs the conversion.

impl PartialEq<Status> for Status[src]

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

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

fn ne(&self, other: &Status) -> bool[src]

This method tests for !=.

impl Try for Status[src]

type Ok = Completion<()>

🔬 This is a nightly-only experimental API. (try_trait)

The type of this value when viewed as successful.

type Error = Error<()>

🔬 This is a nightly-only experimental API. (try_trait)

The type of this value when viewed as failed.

fn into_result(self) -> Result<(), ()>[src]

🔬 This is a nightly-only experimental API. (try_trait)

Applies the “?” operator. A return of Ok(t) means that the execution should continue normally, and the result of ? is the value t. A return of Err(e) means that execution should branch to the innermost enclosing catch, or return from the function. Read more

fn from_error(error: Self::Error) -> Self[src]

🔬 This is a nightly-only experimental API. (try_trait)

Wrap an error value to construct the composite result. For example, Result::Err(x) and Result::from_error(x) are equivalent. Read more

fn from_ok(ok: Self::Ok) -> Self[src]

🔬 This is a nightly-only experimental API. (try_trait)

Wrap an OK value to construct the composite result. For example, Result::Ok(x) and Result::from_ok(x) are equivalent. Read more

impl Copy for Status[src]

impl Eq for Status[src]

impl StructuralEq for Status[src]

impl StructuralPartialEq for Status[src]

Auto Trait Implementations

impl Send for Status

impl Sync for Status

impl Unpin for Status

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.