Struct ascent_base::Dual
source · [−]pub struct Dual<T>(pub T);Expand description
A wrapper that swaps (<= and >=), (meet and join),
and (top and bottom) for BoundedLattices.
Example
assert!(Dual(2) < Dual(1));Tuple Fields
0: TTrait Implementations
sourceimpl<T> BoundedLattice for Dual<T> where
T: BoundedLattice,
Dual<T>: Lattice,
impl<T> BoundedLattice for Dual<T> where
T: BoundedLattice,
Dual<T>: Lattice,
sourceimpl<T> Lattice for Dual<T> where
T: Lattice,
impl<T> Lattice for Dual<T> where
T: Lattice,
sourcefn meet(self, other: Self) -> Self
fn meet(self, other: Self) -> Self
the greatest lower bound of two elements. meet(x, y) is the largest value x
s.t. z <= x and z <= y Read more
sourcefn join(self, other: Self) -> Self
fn join(self, other: Self) -> Self
The least upper bound of two elements. join(x, y) is the smallest value z
s.t. z >= x and z >= y. Read more
sourceimpl<T> Ord for Dual<T> where
T: Ord,
impl<T> Ord for Dual<T> where
T: Ord,
sourceimpl<T> PartialOrd<Dual<T>> for Dual<T> where
T: PartialOrd,
impl<T> PartialOrd<Dual<T>> for Dual<T> where
T: PartialOrd,
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn 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 more
impl<T: Copy> Copy for Dual<T>
impl<T: Eq> Eq for Dual<T>
impl<T> StructuralEq for Dual<T>
impl<T> StructuralPartialEq for Dual<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Dual<T> where
T: RefUnwindSafe,
impl<T> Send for Dual<T> where
T: Send,
impl<T> Sync for Dual<T> where
T: Sync,
impl<T> Unpin for Dual<T> where
T: Unpin,
impl<T> UnwindSafe for Dual<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more