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