[−][src]Struct pergola::MinOpt
This lattice is similar to MaxDef
but inverts the order, with the
minimal value according to Ord::cmp
as its join, and the unit being a
putative "maximal" value of the element type. Since several Ord types do not
have a maximal value (think strings, maps, etc.) MinOpt
represents its
element using an Option
where None
is the "maximal" value (that forms
the lattice unit) and Some
is for the other non-unit values.
Note this may not be quite what you want if your type does have a maximal
element. For example this will make the unit of u32
still be None
, not
std::u32::MAX
. For those, use MinNum
. Both are safe, but
MinOpt
is weird in those cases.
Trait Implementations
impl<M: Clone + DefTraits> Clone for MinOpt<M>
[src]
impl<M: Debug + DefTraits> Debug for MinOpt<M>
[src]
impl<M: Default + DefTraits> Default for MinOpt<M>
[src]
impl<'de, M: DefTraits> Deserialize<'de> for MinOpt<M>
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<M: Eq + DefTraits> Eq for MinOpt<M>
[src]
impl<M: Hash + DefTraits> Hash for MinOpt<M>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<M: DefTraits> LatticeDef for MinOpt<M>
[src]
type T = Option<M>
pub fn unit() -> Self::T
[src]
pub fn join(lhs: &Self::T, rhs: &Self::T) -> Self::T
[src]
pub fn partial_order(lhs: &Self::T, rhs: &Self::T) -> Option<Ordering>
[src]
impl<M: Ord + DefTraits> Ord for MinOpt<M>
[src]
pub fn cmp(&self, other: &MinOpt<M>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<M: PartialEq + DefTraits> PartialEq<MinOpt<M>> for MinOpt<M>
[src]
impl<M: PartialOrd + DefTraits> PartialOrd<MinOpt<M>> for MinOpt<M>
[src]
pub fn partial_cmp(&self, other: &MinOpt<M>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &MinOpt<M>) -> bool
[src]
pub fn le(&self, other: &MinOpt<M>) -> bool
[src]
pub fn gt(&self, other: &MinOpt<M>) -> bool
[src]
pub fn ge(&self, other: &MinOpt<M>) -> bool
[src]
impl<M: DefTraits> Serialize for MinOpt<M>
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<M: DefTraits> StructuralEq for MinOpt<M>
[src]
impl<M: DefTraits> StructuralPartialEq for MinOpt<M>
[src]
Auto Trait Implementations
impl<M> RefUnwindSafe for MinOpt<M> where
M: RefUnwindSafe,
[src]
M: RefUnwindSafe,
impl<M> Send for MinOpt<M> where
M: Send,
[src]
M: Send,
impl<M> Sync for MinOpt<M> where
M: Sync,
[src]
M: Sync,
impl<M> Unpin for MinOpt<M> where
M: Unpin,
[src]
M: Unpin,
impl<M> UnwindSafe for MinOpt<M> where
M: UnwindSafe,
[src]
M: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,