[−][src]Enum gf::support::lattice::PosetLattice
Lattice constructed from a partially ordered set by adding dedicated bottom and top elements.
Example
This example uses PosetLattice
to calculate minimum and maximum of two
integers.
let a = PosetLattice::from(10u32); let b = PosetLattice::from(20u32); // Normal elements compare according to their `PartialOrd`. assert_eq!(Meet::meet(&a, &b), a); assert_eq!(Join::join(&a, &b), b); // Bottom is less and top is greater than anything else. assert_eq!(Meet::meet(&PosetLattice::Bottom, &a), PosetLattice::Bottom); assert_eq!(Meet::meet(&PosetLattice::Top, &a), a);
Variants
Dedicated bottom element, ⊥.
Dedicated top element, ⊤.
Normal element.
Implementations
impl<T> PosetLattice<T>
[src]
pub fn as_ref(&self) -> PosetLattice<&T>
[src]
Convert from a &PosetLattice<T>
to PosetLattice<&T>
.
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> PosetLattice<U>
[src]
Map normal elements using f
, while preserving dedicated bottom and top
elements.
pub fn and_then<U, F: FnOnce(T) -> PosetLattice<U>>(
self,
f: F
) -> PosetLattice<U>
[src]
self,
f: F
) -> PosetLattice<U>
Map normal elements using f
which may also return bottom or top, while
preserving bottom and top elements.
impl<'a, T: Clone> PosetLattice<&'a T>
[src]
pub fn cloned(self) -> PosetLattice<T>
[src]
Convert from a &PosetLattice<T>
to PosetLattice<T>
by cloning the
element.
impl<'a, T: Copy> PosetLattice<&'a T>
[src]
pub fn copied(self) -> PosetLattice<T>
[src]
Convert from a &PosetLattice<T>
to PosetLattice<T>
by copying the
element.
Trait Implementations
impl<T: Eq> Bottom for PosetLattice<T>
[src]
fn bottom() -> Self
[src]
fn is_bottom(&self) -> bool
[src]
fn to_option(self) -> Option<Self>
[src]
fn reset_to_bottom(&mut self)
[src]
impl<T: Clone> Clone for PosetLattice<T>
[src]
fn clone(&self) -> PosetLattice<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for PosetLattice<T>
[src]
impl<T: Debug> Debug for PosetLattice<T>
[src]
impl<T: Eq> Eq for PosetLattice<T>
[src]
impl<T> From<T> for PosetLattice<T>
[src]
impl<T: Hash> Hash for PosetLattice<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Clone + Eq + PartialOrd> Join for PosetLattice<T>
[src]
impl<T: Clone + Eq + PartialOrd> Meet for PosetLattice<T>
[src]
impl<T: PartialEq> PartialEq<PosetLattice<T>> for PosetLattice<T>
[src]
fn eq(&self, other: &PosetLattice<T>) -> bool
[src]
fn ne(&self, other: &PosetLattice<T>) -> bool
[src]
impl<T> StructuralEq for PosetLattice<T>
[src]
impl<T> StructuralPartialEq for PosetLattice<T>
[src]
impl<T: Eq> Top for PosetLattice<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for PosetLattice<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PosetLattice<T> where
T: Send,
T: Send,
impl<T> Sync for PosetLattice<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PosetLattice<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PosetLattice<T> where
T: UnwindSafe,
T: 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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,