pub enum AutoOption<T> {
Fix(T),
Auto,
}
Expand description
An enumeration of something that can either be fixed (e.g. the maximum of X values), or automatically determined
Variants§
Implementations§
Source§impl<T> AutoOption<T>
impl<T> AutoOption<T>
Sourcepub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> AutoOption<U>
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> AutoOption<U>
Same as Option::map
Trait Implementations§
Source§impl<T: Clone> Clone for AutoOption<T>
impl<T: Clone> Clone for AutoOption<T>
Source§fn clone(&self) -> AutoOption<T>
fn clone(&self) -> AutoOption<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for AutoOption<T>
impl<T: Debug> Debug for AutoOption<T>
Source§impl<T: Ord> Ord for AutoOption<T>
impl<T: Ord> Ord for AutoOption<T>
Source§fn cmp(&self, other: &AutoOption<T>) -> Ordering
fn cmp(&self, other: &AutoOption<T>) -> Ordering
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: PartialEq> PartialEq for AutoOption<T>
impl<T: PartialEq> PartialEq for AutoOption<T>
Source§impl<T: PartialOrd> PartialOrd for AutoOption<T>
impl<T: PartialOrd> PartialOrd for AutoOption<T>
impl<T: Copy> Copy for AutoOption<T>
impl<T: Eq> Eq for AutoOption<T>
impl<T> StructuralPartialEq for AutoOption<T>
Auto Trait Implementations§
impl<T> Freeze for AutoOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for AutoOption<T>where
T: RefUnwindSafe,
impl<T> Send for AutoOption<T>where
T: Send,
impl<T> Sync for AutoOption<T>where
T: Sync,
impl<T> Unpin for AutoOption<T>where
T: Unpin,
impl<T> UnwindSafe for AutoOption<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