pub struct Min<T>(/* private fields */);
Expand description
A totally ordered min lattice. Merging returns the smaller value.
This means the lattice order is the reverse of what you might naturally expect: 0 is greater than 1.
Note that the Default::default()
value for numeric type is MAX
, not zero.
Implementations§
source§impl<T> Min<T>
impl<T> Min<T>
sourcepub fn new_from(val: impl Into<T>) -> Self
pub fn new_from(val: impl Into<T>) -> Self
Create a new Min
lattice instance from an Into<T>
value.
sourcepub fn as_reveal_ref(&self) -> &T
pub fn as_reveal_ref(&self) -> &T
Reveal the inner value as a shared reference.
sourcepub fn as_reveal_mut(&mut self) -> &mut T
pub fn as_reveal_mut(&mut self) -> &mut T
Reveal the inner value as an exclusive reference.
sourcepub fn into_reveal(self) -> T
pub fn into_reveal(self) -> T
Gets the inner by value, consuming self.
Trait Implementations§
source§impl<T> DeepReveal for Min<T>
impl<T> DeepReveal for Min<T>
source§impl<'de, T> Deserialize<'de> for Min<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Min<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> LatticeFrom<Min<T>> for Min<T>
impl<T> LatticeFrom<Min<T>> for Min<T>
source§fn lattice_from(other: Min<T>) -> Self
fn lattice_from(other: Min<T>) -> Self
Convert from the
Other
lattice into Self
.source§impl<T> Ord for Min<T>where
T: Ord,
impl<T> Ord for Min<T>where
T: Ord,
source§impl<T: PartialEq> PartialEq for Min<T>
impl<T: PartialEq> PartialEq for Min<T>
source§impl<T> PartialOrd for Min<T>where
T: PartialOrd,
impl<T> PartialOrd for Min<T>where
T: PartialOrd,
1.0.0 · source§fn 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> Copy for Min<T>
impl<T: Eq> Eq for Min<T>
impl<T> LatticeOrd for Min<T>where
Self: PartialOrd<Self>,
impl<T> StructuralPartialEq for Min<T>
Auto Trait Implementations§
impl<T> Freeze for Min<T>where
T: Freeze,
impl<T> RefUnwindSafe for Min<T>where
T: RefUnwindSafe,
impl<T> Send for Min<T>where
T: Send,
impl<T> Sync for Min<T>where
T: Sync,
impl<T> Unpin for Min<T>where
T: Unpin,
impl<T> UnwindSafe for Min<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
source§impl<This, Other> NaiveLatticeOrd<Other> for This
impl<This, Other> NaiveLatticeOrd<Other> for This
source§fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>
fn naive_cmp(&self, other: &Rhs) -> Option<Ordering>
Naive compare based on the
Merge::merge
method. This method can be very inefficient;
use PartialOrd::partial_cmp
instead. Read more