pub struct Max<T>(/* private fields */);
Expand description
A totally ordered max lattice. Merging returns the larger value.
Note that the Default::default()
value for numeric type is MIN
, not zero.
Implementations§
source§impl<T> Max<T>
impl<T> Max<T>
sourcepub fn from(val: impl Into<T>) -> Self
pub fn from(val: impl Into<T>) -> Self
Create a new Max
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 Max<T>
impl<T> DeepReveal for Max<T>
source§impl<'de, T> Deserialize<'de> for Max<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Max<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<Max<T>> for Max<T>
impl<T> LatticeFrom<Max<T>> for Max<T>
source§fn lattice_from(other: Max<T>) -> Self
fn lattice_from(other: Max<T>) -> Self
Convert from the
Other
lattice into Self
.source§impl<T: Ord> Ord for Max<T>
impl<T: Ord> Ord for Max<T>
source§impl<T: PartialOrd> PartialOrd for Max<T>
impl<T: PartialOrd> PartialOrd for Max<T>
impl<T: Copy> Copy for Max<T>
impl<T: Eq> Eq for Max<T>
impl<T> LatticeOrd for Max<T>where
Self: PartialOrd<Self>,
impl<T> StructuralPartialEq for Max<T>
Auto Trait Implementations§
impl<T> Freeze for Max<T>where
T: Freeze,
impl<T> RefUnwindSafe for Max<T>where
T: RefUnwindSafe,
impl<T> Send for Max<T>where
T: Send,
impl<T> Sync for Max<T>where
T: Sync,
impl<T> Unpin for Max<T>where
T: Unpin,
impl<T> UnwindSafe for Max<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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