Struct uefi::Completion
source · [−]pub struct Completion<T> { /* private fields */ }
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
sourceimpl<T> Completion<T>
impl<T> Completion<T>
sourcepub fn new(status: Status, result: T) -> Self
pub fn new(status: Status, result: T) -> Self
Build a completion from a non-error status and a function result
sourcepub fn expect(self, msg: &str) -> T
pub fn expect(self, msg: &str) -> T
Assume that no warning occured, panic with provided message if not
sourcepub fn map<U>(self, f: impl FnOnce(T) -> U) -> Completion<U>
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Completion<U>
Transform the inner value without unwrapping the Completion
sourcepub fn with_status(self, extra_status: Status) -> Self
pub fn with_status(self, extra_status: Status) -> Self
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
sourceimpl<T: Clone> Clone for Completion<T>
impl<T: Clone> Clone for Completion<T>
sourcefn clone(&self) -> Completion<T>
fn clone(&self) -> Completion<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug> Debug for Completion<T>
impl<T: Debug> Debug for Completion<T>
sourceimpl From<Status> for Completion<()>
impl From<Status> for Completion<()>
sourceimpl<T> From<T> for Completion<T>
impl<T> From<T> for Completion<T>
sourceimpl<T: PartialEq> PartialEq<Completion<T>> for Completion<T>
impl<T: PartialEq> PartialEq<Completion<T>> for Completion<T>
sourcefn eq(&self, other: &Completion<T>) -> bool
fn eq(&self, other: &Completion<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Completion<T>) -> bool
fn ne(&self, other: &Completion<T>) -> bool
This method tests for !=
.
impl<T: Copy> Copy for Completion<T>
impl<T> StructuralPartialEq for Completion<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Completion<T> where
T: RefUnwindSafe,
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,
impl<T> UnwindSafe for Completion<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more