pub enum Partial<T> {
Value(T),
Fake(T),
Nothing,
}
Variants§
Implementations§
Source§impl<T> Partial<T>
impl<T> Partial<T>
pub fn unwrap(self) -> T
pub fn unwrap_all(self) -> T
pub fn expect(self, msg: &str) -> T
pub fn ensure(self, msg: &str) -> Self
pub fn unwrap_or_else<F>(self, f: F) -> Twhere
F: FnOnce() -> T,
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Partial<U>
pub fn and_then<U, F: FnOnce(T) -> Partial<U>>(self, f: F) -> Partial<U>
pub fn and_next<U, F: FnOnce(T) -> Partial<U>>(self, f: F) -> Partial<U>
pub fn is_value(&self) -> bool
pub fn is_fake(&self) -> bool
pub fn is_nothing(&self) -> bool
Trait Implementations§
Source§impl<T: Ord> Ord for Partial<T>
impl<T: Ord> Ord for Partial<T>
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: PartialOrd> PartialOrd for Partial<T>
impl<T: PartialOrd> PartialOrd for Partial<T>
impl<T: Eq> Eq for Partial<T>
impl<T> StructuralPartialEq for Partial<T>
Auto Trait Implementations§
impl<T> Freeze for Partial<T>where
T: Freeze,
impl<T> RefUnwindSafe for Partial<T>where
T: RefUnwindSafe,
impl<T> Send for Partial<T>where
T: Send,
impl<T> Sync for Partial<T>where
T: Sync,
impl<T> Unpin for Partial<T>where
T: Unpin,
impl<T> UnwindSafe for Partial<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