pub struct MaybeWarnings<T> {
pub value: T,
pub warnings: Option<Vec<Warning>>,
}Expand description
A result that may contain warnings.
Fields§
§value: TThe successful result value.
warnings: Option<Vec<Warning>>The list of warnings that occurred, if any.
Implementations§
Source§impl<T> MaybeWarnings<T>
impl<T> MaybeWarnings<T>
Sourcepub fn into_result(self) -> Result<T>
pub fn into_result(self) -> Result<T>
Extracts the successful result value, returning Error::UnhandledWarnings if any warnings occurred.
Sourcepub fn inspect_warnings<F: FnOnce(&Vec<Warning>)>(self, f: F) -> Self
pub fn inspect_warnings<F: FnOnce(&Vec<Warning>)>(self, f: F) -> Self
Calls a function with a reference to the warnings, if any.
Trait Implementations§
Source§impl<T: Clone> Clone for MaybeWarnings<T>
impl<T: Clone> Clone for MaybeWarnings<T>
Source§fn clone(&self) -> MaybeWarnings<T>
fn clone(&self) -> MaybeWarnings<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for MaybeWarnings<T>
impl<T: Debug> Debug for MaybeWarnings<T>
Source§impl<T: Default> Default for MaybeWarnings<T>
impl<T: Default> Default for MaybeWarnings<T>
Source§fn default() -> MaybeWarnings<T>
fn default() -> MaybeWarnings<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for MaybeWarnings<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaybeWarnings<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeWarnings<T>where
T: Send,
impl<T> Sync for MaybeWarnings<T>where
T: Sync,
impl<T> Unpin for MaybeWarnings<T>where
T: Unpin,
impl<T> UnsafeUnpin for MaybeWarnings<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for MaybeWarnings<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more