Struct lattices::Min

source ·
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>

source

pub fn new(val: T) -> Self

Create a new Min lattice instance from a T.

source

pub fn new_from(val: impl Into<T>) -> Self

Create a new Min lattice instance from an Into<T> value.

source

pub fn as_reveal_ref(&self) -> &T

Reveal the inner value as a shared reference.

source

pub fn as_reveal_mut(&mut self) -> &mut T

Reveal the inner value as an exclusive reference.

source

pub fn into_reveal(self) -> T

Gets the inner by value, consuming self.

Trait Implementations§

source§

impl<T: Clone> Clone for Min<T>

source§

fn clone(&self) -> Min<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Min<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> DeepReveal for Min<T>

§

type Revealed = T

The underlying type when revealed.
source§

fn deep_reveal(self) -> Self::Revealed

Reveals the underlying lattice types recursively.
source§

impl Default for Min<bool>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<char>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<i128>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<i16>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<i32>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<i64>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<i8>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<isize>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<u128>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<u16>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<u32>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<u64>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<u8>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Default for Min<usize>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl IsBot for Min<()>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<bool>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<char>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<i128>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<i16>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<i32>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<i64>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<i8>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<isize>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<u128>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<u16>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<u32>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<u64>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<u8>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsBot for Min<usize>

source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
source§

impl IsTop for Min<()>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<bool>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<char>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<i128>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<i16>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<i32>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<i64>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<i8>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<isize>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<u128>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<u16>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<u32>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<u64>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<u8>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl IsTop for Min<usize>

source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
source§

impl<T> LatticeFrom<Min<T>> for Min<T>

source§

fn lattice_from(other: Min<T>) -> Self

Convert from the Other lattice into Self.
source§

impl<T> Merge<Min<T>> for Min<T>
where T: Ord,

source§

fn merge(&mut self, other: Min<T>) -> bool

Merge other into the self lattice. Read more
source§

fn merge_owned(this: Self, delta: Other) -> Self
where Self: Sized,

Merge this and delta together, returning the new value.
source§

impl<T> Ord for Min<T>
where T: Ord,

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq> PartialEq for Min<T>

source§

fn eq(&self, other: &Min<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd for Min<T>
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> Serialize for Min<T>
where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Copy> Copy for Min<T>

source§

impl<T: Eq> Eq for Min<T>

source§

impl<T> LatticeOrd for Min<T>
where Self: PartialOrd<Self>,

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<This, Other> NaiveLatticeOrd<Other> for This
where This: Clone + Merge<Other>, Other: Clone + Merge<This>,

source§

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
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Lattice for T