Struct uefi::Completion[][src]

#[must_use]
pub struct Completion<T> { /* fields omitted */ }
Expand description

This type is used when an UEFI operation has completed, but some non-fatal problems (UEFI warnings) may have been encountered along the way

Implementations

impl<T> Completion<T>[src]

pub fn new(status: Status, result: T) -> Self[src]

Build a completion from a non-error status and a function result

pub fn status(&self) -> Status[src]

Extract the status of this completion

pub fn split(self) -> (Status, T)[src]

Split this completion into its inner status and result data

pub fn log(self) -> T[src]

Access the inner value, logging the warning if there is any

pub fn unwrap(self) -> T[src]

Assume that no warning occured, panic if not

pub fn expect(self, msg: &str) -> T[src]

Assume that no warning occured, panic with provided message if not

pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Completion<U>[src]

Transform the inner value without unwrapping the Completion

pub fn with_status(self, extra_status: Status) -> Self[src]

Merge this completion with a success or warning status

Since this type only has storage for one warning, if two warnings must be stored, one of them will be spilled into the logs.

Trait Implementations

impl<T: Clone> Clone for Completion<T>[src]

fn clone(&self) -> Completion<T>[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<T: Debug> Debug for Completion<T>[src]

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

Formats the value using the given formatter. Read more

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

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

Performs the conversion.

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

fn from(result: T) -> Self[src]

Performs the conversion.

impl<T: PartialEq> PartialEq<Completion<T>> for Completion<T>[src]

fn eq(&self, other: &Completion<T>) -> bool[src]

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

fn ne(&self, other: &Completion<T>) -> bool[src]

This method tests for !=.

impl<T: Copy> Copy for Completion<T>[src]

impl<T> StructuralPartialEq for Completion<T>[src]

Auto Trait Implementations

impl<T> Send for Completion<T> where
    T: Send

impl<T> Sync for Completion<T> where
    T: Sync

impl<T> Unpin for Completion<T> where
    T: Unpin

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<!> for T[src]

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

Performs the conversion.

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.