pub trait CpCmp<T> {
Show 15 methods
// Required methods
fn cp(&self, v: &T) -> T;
fn min_ref(&self) -> &T;
fn max_ref(&self) -> &T;
fn lt(&self, a: &T, b: &T) -> bool;
fn min(&self) -> T;
fn max(&self) -> T;
// Provided methods
fn gt(&self, a: &T, b: &T) -> bool { ... }
fn eq(&self, a: &T, b: &T) -> bool { ... }
fn ne(&self, a: &T, b: &T) -> bool { ... }
fn le(&self, a: &T, b: &T) -> bool { ... }
fn ge(&self, a: &T, b: &T) -> bool { ... }
fn contains(&self, a: &T, b: &T, c: &T) -> bool { ... }
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T) { ... }
fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool { ... }
fn is_invalid_set(&self, a: &T, b: &T) -> bool { ... }
}Expand description
Copy and Compare Values
For an implementation examples and details see: IncDecCpCmp.
Required Methods§
fn cp(&self, v: &T) -> T
fn min_ref(&self) -> &T
fn max_ref(&self) -> &T
Sourcefn min(&self) -> T
fn min(&self) -> T
Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Sourcefn max(&self) -> T
fn max(&self) -> T
Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Provided Methods§
Sourcefn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Sourcefn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool
fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool
Returns true if any of the following are true
- a and b contain c
- a and b contain d
- c and d contain a
- c and d contain b
Sourcefn is_invalid_set(&self, a: &T, b: &T) -> bool
fn is_invalid_set(&self, a: &T, b: &T) -> bool
Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".