pub struct Maybe<A>(pub Option<A>);Expand description
A simple Maybe monad (equivalent to Option).
Tuple Fields§
§0: Option<A>Implementations§
Source§impl<A> Maybe<A>
impl<A> Maybe<A>
Sourcepub fn is_nothing(&self) -> bool
pub fn is_nothing(&self) -> bool
Return true if this is Nothing.
Sourcepub fn into_option(self) -> Option<A>
pub fn into_option(self) -> Option<A>
Return the inner Option.
Trait Implementations§
impl<A: Eq> Eq for Maybe<A>
impl<A> StructuralPartialEq for Maybe<A>
Auto Trait Implementations§
impl<A> Freeze for Maybe<A>where
A: Freeze,
impl<A> RefUnwindSafe for Maybe<A>where
A: RefUnwindSafe,
impl<A> Send for Maybe<A>where
A: Send,
impl<A> Sync for Maybe<A>where
A: Sync,
impl<A> Unpin for Maybe<A>where
A: Unpin,
impl<A> UnsafeUnpin for Maybe<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Maybe<A>where
A: 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