pub struct MayError<T, E> {
pub ok: T,
pub err: Option<E>,
}
Fields§
§ok: T
§err: Option<E>
Implementations§
Source§impl<T, E> MayError<T, E>
impl<T, E> MayError<T, E>
pub fn ok(result: T) -> MayError<T, E>
pub fn err(ok: T, err: E) -> MayError<T, E>
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> MayError<U, E>
pub fn split(self) -> (T, Option<E>)
pub fn into_ok(self) -> T
pub fn into_err(self) -> Option<E>
pub fn unwrap_err(self) -> E
pub fn into_result(self) -> Result<T, E>
Trait Implementations§
Source§impl<T, E> Ord for MayError<T, E>
impl<T, E> Ord for MayError<T, E>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T, E> PartialOrd for MayError<T, E>where
T: PartialOrd,
E: PartialOrd,
impl<T, E> PartialOrd for MayError<T, E>where
T: PartialOrd,
E: PartialOrd,
impl<T, E> Copy for MayError<T, E>
impl<T, E> Eq for MayError<T, E>
impl<T, E> StructuralPartialEq for MayError<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for MayError<T, E>
impl<T, E> RefUnwindSafe for MayError<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for MayError<T, E>
impl<T, E> Sync for MayError<T, E>
impl<T, E> Unpin for MayError<T, E>
impl<T, E> UnwindSafe for MayError<T, E>where
T: UnwindSafe,
E: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.