Struct fera_optional::Optioned
source · pub struct Optioned<T, B: BuildNone<T>> { /* private fields */ }
Expand description
An Optional
that represents None
with a specified value (B::none()
) of T
domain.
Trait Implementations
sourceimpl<T: Eq, B: BuildNone<T>> Optional<T> for Optioned<T, B>
impl<T: Eq, B: BuildNone<T>> Optional<T> for Optioned<T, B>
sourcefn to_option_ref(&self) -> Option<&T>
fn to_option_ref(&self) -> Option<&T>
Returns an
Option<&T>
that is equivalent to this Optional
.sourcefn to_option_mut(&mut self) -> Option<&mut T>
fn to_option_mut(&mut self) -> Option<&mut T>
Returns an
Option<&mut T>
that is equivalent to this Optional
.sourcefn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this
Optional
to the equivalent Option
.sourceimpl<T: Ord, B: Ord + BuildNone<T>> Ord for Optioned<T, B>
impl<T: Ord, B: Ord + BuildNone<T>> Ord for Optioned<T, B>
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq, B: PartialEq + BuildNone<T>> PartialEq<Optioned<T, B>> for Optioned<T, B>
impl<T: PartialEq, B: PartialEq + BuildNone<T>> PartialEq<Optioned<T, B>> for Optioned<T, B>
sourceimpl<T: PartialOrd, B: PartialOrd + BuildNone<T>> PartialOrd<Optioned<T, B>> for Optioned<T, B>
impl<T: PartialOrd, B: PartialOrd + BuildNone<T>> PartialOrd<Optioned<T, B>> for Optioned<T, B>
sourcefn partial_cmp(&self, other: &Optioned<T, B>) -> Option<Ordering>
fn partial_cmp(&self, other: &Optioned<T, B>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy, B: Copy + BuildNone<T>> Copy for Optioned<T, B>
impl<T: Eq, B: Eq + BuildNone<T>> Eq for Optioned<T, B>
impl<T, B: BuildNone<T>> StructuralEq for Optioned<T, B>
impl<T, B: BuildNone<T>> StructuralPartialEq for Optioned<T, B>
Auto Trait Implementations
impl<T, B> RefUnwindSafe for Optioned<T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, B> Send for Optioned<T, B>where
B: Send,
T: Send,
impl<T, B> Sync for Optioned<T, B>where
B: Sync,
T: Sync,
impl<T, B> Unpin for Optioned<T, B>where
B: Unpin,
T: Unpin,
impl<T, B> UnwindSafe for Optioned<T, B>where
B: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more