Trait ComparisonOps
Source pub trait ComparisonOps {
// Required methods
fn equal(&self, other: &Self) -> Result<Self, String>
where Self: Sized;
fn not_equal(&self, other: &Self) -> Result<Self, String>
where Self: Sized;
fn less_than(&self, other: &Self) -> Result<Self, String>
where Self: Sized;
fn less_than_equal(&self, other: &Self) -> Result<Self, String>
where Self: Sized;
fn greater_than(&self, other: &Self) -> Result<Self, String>
where Self: Sized;
fn greater_than_equal(&self, other: &Self) -> Result<Self, String>
where Self: Sized;
}
Expand description
Comparison operations on values
Tests if two values are equal.
§Arguments
other
- The other value to compare
§Returns
- The result of the equality comparison
- An error message if the types cannot be compared
Tests if two values are not equal.
§Arguments
other
- The other value to compare
§Returns
- The result of the inequality comparison
- An error message if the types cannot be compared
Tests if one value is less than another.
§Arguments
other
- The other value to compare
§Returns
- The result of the less-than comparison
- An error message if the types cannot be compared
Tests if one value is less than or equal to another.
§Arguments
other
- The other value to compare
§Returns
- The result of the less-than-or-equal comparison
- An error message if the types cannot be compared
Tests if one value is greater than another.
§Arguments
other
- The other value to compare
§Returns
- The result of the greater-than comparison
- An error message if the types cannot be compared
Tests if one value is greater than or equal to another.
§Arguments
other
- The other value to compare
§Returns
- The result of the greater-than-or-equal comparison
- An error message if the types cannot be compared