Skip to main content

CpCmp

Trait CpCmp 

Source
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§

Source

fn cp(&self, v: &T) -> T

Source

fn min_ref(&self) -> &T

Source

fn max_ref(&self) -> &T

Source

fn lt(&self, a: &T, b: &T) -> bool

Returns true if a < b.

Source

fn min(&self) -> T

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.

Source

fn max(&self) -> T

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.

Provided Methods§

Source

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.

Source

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.

Source

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.

Source

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.

Source

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.

Source

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.

Source

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.

Source

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
Source

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".

Implementors§