pub trait IsNone: Clonewhere
Self: Sized,{
type Inner: IsNone<Inner = Self::Inner>;
type Cast<U: IsNone<Inner = U>>: IsNone<Inner = U>;
Show 13 methods
// Required methods
fn is_none(&self) -> bool;
fn none() -> Self;
fn to_opt(self) -> Option<Self::Inner>;
fn as_opt(&self) -> Option<&Self::Inner>;
fn from_inner(inner: Self::Inner) -> Self;
fn inner_cast<U: IsNone<Inner = U>>(inner: U) -> Self::Cast<U>
where Self::Inner: Cast<U::Inner>;
// Provided methods
fn from_opt(opt: Option<Self::Inner>) -> Self { ... }
fn unwrap(self) -> Self::Inner { ... }
fn not_none(&self) -> bool { ... }
fn map<F, U: IsNone>(self, f: F) -> U
where F: Fn(Self::Inner) -> U::Inner { ... }
fn vabs(self) -> Self
where Self::Inner: Number { ... }
fn sort_cmp(&self, other: &Self) -> Ordering
where Self::Inner: PartialOrd { ... }
fn sort_cmp_rev(&self, other: &Self) -> Ordering
where Self::Inner: PartialOrd { ... }
}Required Associated Types§
type Inner: IsNone<Inner = Self::Inner>
type Cast<U: IsNone<Inner = U>>: IsNone<Inner = U>
Required Methods§
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U>>(inner: U) -> Self::Cast<U>
Provided Methods§
fn from_opt(opt: Option<Self::Inner>) -> Self
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
fn vabs(self) -> Self
sourcefn sort_cmp(&self, other: &Self) -> Orderingwhere
Self::Inner: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self::Inner: PartialOrd,
let None value be largest, only for sorting(from smallest to largest)
sourcefn sort_cmp_rev(&self, other: &Self) -> Orderingwhere
Self::Inner: PartialOrd,
fn sort_cmp_rev(&self, other: &Self) -> Orderingwhere
Self::Inner: PartialOrd,
let None value be largest, only for sorting(from largest to smallest)
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl IsNone for bool
impl IsNone for bool
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)
type Inner = bool
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for f32
impl IsNone for f32
type Inner = f32
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for f64
impl IsNone for f64
type Inner = f64
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for i32
impl IsNone for i32
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)
type Inner = i32
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for i64
impl IsNone for i64
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)
type Inner = i64
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for isize
impl IsNone for isize
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)
type Inner = isize
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for u8
impl IsNone for u8
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)
type Inner = u8
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for u64
impl IsNone for u64
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)
type Inner = u64
type Cast<U: IsNone<Inner = U> + Clone> = U
fn is_none(&self) -> bool
fn none() -> Self
fn to_opt(self) -> Option<Self::Inner>
fn as_opt(&self) -> Option<&Self::Inner>
fn from_inner(inner: Self::Inner) -> Self
fn inner_cast<U: IsNone<Inner = U> + Clone>(inner: U) -> Self::Cast<U>
fn unwrap(self) -> Self::Inner
fn not_none(&self) -> bool
fn map<F, U: IsNone>(self, f: F) -> U
source§impl IsNone for usize
impl IsNone for usize
source§fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
fn sort_cmp(&self, other: &Self) -> Orderingwhere
Self: PartialOrd,
only for sorting(from smallest to largest)