pub struct Max<T>(pub T);Expand description
Newtype wrapper for an Ord type where join is max.
join = max(a, b)bottom = T::MIN(when T: Bounded)
§Example
use algebra::JoinSemilattice;
use algebra::Max;
let a = Max(5);
let b = Max(10);
assert_eq!(a.join(&b), Max(10));Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<T: Ord + Clone + Bounded> BoundedJoinSemilattice for Max<T>
impl<T: Ord + Clone + Bounded> BoundedJoinSemilattice for Max<T>
Source§fn join_all_from_bottom<I>(it: I) -> Selfwhere
I: IntoIterator<Item = Self>,
fn join_all_from_bottom<I>(it: I) -> Selfwhere
I: IntoIterator<Item = Self>,
Join a finite iterator of values, starting from ⊥. Read more
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: Ord + Clone> JoinSemilattice for Max<T>
impl<T: Ord + Clone> JoinSemilattice for Max<T>
Source§fn join_assign(&mut self, other: &Self)
fn join_assign(&mut self, other: &Self)
In-place variant.
Source§fn leq(&self, other: &Self) -> boolwhere
Self: PartialEq,
fn leq(&self, other: &Self) -> boolwhere
Self: PartialEq,
Derived partial order: x ≤ y iff x ⊔ y = y.
Source§fn join_all<I>(it: I) -> Option<Self>where
I: IntoIterator<Item = Self>,
fn join_all<I>(it: I) -> Option<Self>where
I: IntoIterator<Item = Self>,
Join a finite iterator of values. Returns
None for empty
iterators.Source§impl<T: Named> Named for Max<T>
impl<T: Named> Named for Max<T>
Source§fn typename() -> &'static str
fn typename() -> &'static str
The globally unique type name for the type.
This should typically be the fully qualified Rust name of the type.
Source§fn typehash() -> u64
fn typehash() -> u64
A globally unique hash for this type.
TODO: actually enforce perfect hashing
§fn typeid() -> TypeId
fn typeid() -> TypeId
The TypeId for this type. TypeIds are unique only within a binary,
and should not be used for global identification.
§fn port() -> u64
fn port() -> u64
The globally unique port for this type. Typed ports are in the range
of 1<<63..1<<64-1.
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> 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,
§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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more