Enum erg_common::triple::Triple
source · pub enum Triple<T, E> {
Ok(T),
Err(E),
None,
}
Variants§
Implementations§
source§impl<T, E> Triple<T, E>
impl<T, E> Triple<T, E>
pub fn none_then(self, err: E) -> Result<T, E>
pub fn none_or_result(self, f: impl FnOnce() -> E) -> Result<T, E>
pub fn none_or_else(self, f: impl FnOnce() -> Triple<T, E>) -> Triple<T, E>
pub fn unwrap_to_result(self) -> Result<T, E>
pub fn ok(self) -> Option<T>
pub fn or_else(self, f: impl FnOnce() -> Result<T, E>) -> Result<T, E>
pub fn unwrap_or(self, default: T) -> T
pub fn unwrap_err(self) -> E
pub fn map_ok<T2>(self, f: impl FnOnce(T) -> T2) -> Triple<T2, E>
pub fn map_ok_or<T2>(self, default: T2, f: impl FnOnce(T) -> T2) -> T2
pub fn map_err<E2>(self, f: impl FnOnce(E) -> E2) -> Triple<T, E2>
Trait Implementations§
source§impl<T: PartialEq, E: PartialEq> PartialEq for Triple<T, E>
impl<T: PartialEq, E: PartialEq> PartialEq for Triple<T, E>
impl<T: Copy, E: Copy> Copy for Triple<T, E>
impl<T: Eq, E: Eq> Eq for Triple<T, E>
impl<T, E> StructuralEq for Triple<T, E>
impl<T, E> StructuralPartialEq for Triple<T, E>
Auto Trait Implementations§
impl<T, E> RefUnwindSafe for Triple<T, E>where E: RefUnwindSafe, T: RefUnwindSafe,
impl<T, E> Send for Triple<T, E>where E: Send, T: Send,
impl<T, E> Sync for Triple<T, E>where E: Sync, T: Sync,
impl<T, E> Unpin for Triple<T, E>where E: Unpin, T: Unpin,
impl<T, E> UnwindSafe for Triple<T, E>where E: UnwindSafe, 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