Struct lattices::Pair

source ·
pub struct Pair<LatA, LatB> { /* private fields */ }
Expand description

Pair compound lattice.

LatA and LatB specify the nested lattice types.

When merging, both sub-lattices are always merged.

Implementations§

source§

impl<LatA, LatB> Pair<LatA, LatB>

source

pub fn new(a: LatA, b: LatB) -> Self

Create a Pair from the given values.

source

pub fn new_from(a: impl Into<LatA>, b: impl Into<LatB>) -> Self

Create a Pair from the given values, using Into.

source

pub fn as_reveal_ref(&self) -> (&LatA, &LatB)

Reveal the inner value as a shared reference.

source

pub fn as_reveal_mut(&mut self) -> (&mut LatA, &mut LatB)

Reveal the inner value as an exclusive reference.

source

pub fn into_reveal(self) -> (LatA, LatB)

Gets the inner by value, consuming self.

Trait Implementations§

source§

impl<LatA: Clone, LatB: Clone> Clone for Pair<LatA, LatB>

source§

fn clone(&self) -> Pair<LatA, LatB>

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<LatA: Debug, LatB: Debug> Debug for Pair<LatA, LatB>

source§

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

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

impl<LatA, LatB> DeepReveal for Pair<LatA, LatB>
where LatA: DeepReveal, LatB: DeepReveal,

§

type Revealed = (<LatA as DeepReveal>::Revealed, <LatB as DeepReveal>::Revealed)

The underlying type when revealed.
source§

fn deep_reveal(self) -> Self::Revealed

Reveals the underlying lattice types recursively.
source§

impl<LatA: Default, LatB: Default> Default for Pair<LatA, LatB>

source§

fn default() -> Pair<LatA, LatB>

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

impl<'de, LatA, LatB> Deserialize<'de> for Pair<LatA, LatB>
where LatA: Deserialize<'de>, LatB: 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<Key, Val> IsBot for Pair<Key, Val>
where Key: IsBot, Val: IsBot,

source§

fn is_bot(&self) -> bool

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

impl<Key, Val> IsTop for Pair<Key, Val>
where Key: IsTop, Val: IsTop,

source§

fn is_top(&self) -> bool

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

impl<LatASelf, LatAOther, LatBSelf, LatBOther> LatticeFrom<Pair<LatAOther, LatBOther>> for Pair<LatASelf, LatBSelf>
where LatASelf: LatticeFrom<LatAOther>, LatBSelf: LatticeFrom<LatBOther>,

source§

fn lattice_from(other: Pair<LatAOther, LatBOther>) -> Self

Convert from the Other lattice into Self.
source§

impl<LatASelf, LatAOther, LatBSelf, LatBOther> Merge<Pair<LatAOther, LatBOther>> for Pair<LatASelf, LatBSelf>
where LatASelf: Merge<LatAOther>, LatBSelf: Merge<LatBOther>,

source§

fn merge(&mut self, other: Pair<LatAOther, LatBOther>) -> 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<LatASelf, LatAOther, LatBSelf, LatBOther> PartialEq<Pair<LatAOther, LatBOther>> for Pair<LatASelf, LatBSelf>
where LatASelf: PartialEq<LatAOther>, LatBSelf: PartialEq<LatBOther>,

source§

fn eq(&self, other: &Pair<LatAOther, LatBOther>) -> 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<LatASelf, LatAOther, LatBSelf, LatBOther> PartialOrd<Pair<LatAOther, LatBOther>> for Pair<LatASelf, LatBSelf>
where LatASelf: PartialOrd<LatAOther>, LatBSelf: PartialOrd<LatBOther>,

source§

fn partial_cmp(&self, other: &Pair<LatAOther, LatBOther>) -> 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<LatA, LatB> Serialize for Pair<LatA, LatB>
where LatA: Serialize, LatB: 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<LatA: Copy, LatB: Copy> Copy for Pair<LatA, LatB>

source§

impl<LatA: Eq, LatB: Eq> Eq for Pair<LatA, LatB>

source§

impl<LatASelf, LatAOther, LatBSelf, LatBOther> LatticeOrd<Pair<LatAOther, LatBOther>> for Pair<LatASelf, LatBSelf>
where Self: PartialOrd<Pair<LatAOther, LatBOther>>,

Auto Trait Implementations§

§

impl<LatA, LatB> Freeze for Pair<LatA, LatB>
where LatA: Freeze, LatB: Freeze,

§

impl<LatA, LatB> RefUnwindSafe for Pair<LatA, LatB>
where LatA: RefUnwindSafe, LatB: RefUnwindSafe,

§

impl<LatA, LatB> Send for Pair<LatA, LatB>
where LatA: Send, LatB: Send,

§

impl<LatA, LatB> Sync for Pair<LatA, LatB>
where LatA: Sync, LatB: Sync,

§

impl<LatA, LatB> Unpin for Pair<LatA, LatB>
where LatA: Unpin, LatB: Unpin,

§

impl<LatA, LatB> UnwindSafe for Pair<LatA, LatB>
where LatA: UnwindSafe, LatB: 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