pub enum Maybe<T> {
Undefined,
Defined(T),
}
Expand description
Variants§
Implementations§
Source§impl<T> Maybe<T>
impl<T> Maybe<T>
pub fn from_option(v: Option<T>) -> Self
pub fn into_option(self) -> Option<T>
pub fn as_ref(&self) -> Maybe<&T>
Source§impl<T: JsCast> Maybe<WrapJsCast<T>>
impl<T: JsCast> Maybe<WrapJsCast<T>>
pub fn wrap_js_cast(v: T) -> Self
Trait Implementations§
Source§impl<T: Ord> Ord for Maybe<T>
impl<T: Ord> Ord for Maybe<T>
Source§impl<T: PartialOrd> PartialOrd for Maybe<T>
impl<T: PartialOrd> PartialOrd for Maybe<T>
impl<T: Copy> Copy for Maybe<T>
impl<T: Eq> Eq for Maybe<T>
impl<T> StructuralPartialEq for Maybe<T>
Auto Trait Implementations§
impl<T> Freeze for Maybe<T>where
T: Freeze,
impl<T> RefUnwindSafe for Maybe<T>where
T: RefUnwindSafe,
impl<T> Send for Maybe<T>where
T: Send,
impl<T> Sync for Maybe<T>where
T: Sync,
impl<T> Unpin for Maybe<T>where
T: Unpin,
impl<T> UnwindSafe for Maybe<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