pub trait VrlValueArithmetic: Sized {
Show 13 methods
// Required methods
fn try_mul(self, rhs: Self) -> Result<Self, ValueError>;
fn try_div(self, rhs: Self) -> Result<Self, ValueError>;
fn try_add(self, rhs: Self) -> Result<Self, ValueError>;
fn try_sub(self, rhs: Self) -> Result<Self, ValueError>;
fn try_or(
self,
rhs: impl FnMut() -> Result<Self, ExpressionError>,
) -> Result<Self, ValueError>;
fn try_and(self, rhs: Self) -> Result<Self, ValueError>;
fn try_rem(self, rhs: Self) -> Result<Self, ValueError>;
fn try_gt(self, rhs: Self) -> Result<Self, ValueError>;
fn try_ge(self, rhs: Self) -> Result<Self, ValueError>;
fn try_lt(self, rhs: Self) -> Result<Self, ValueError>;
fn try_le(self, rhs: Self) -> Result<Self, ValueError>;
fn try_merge(self, rhs: Self) -> Result<Self, ValueError>;
fn eq_lossy(&self, rhs: &Self) -> bool;
}Required Methods§
Sourcefn try_mul(self, rhs: Self) -> Result<Self, ValueError>
fn try_mul(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::ops::Mul, but fallible (e.g. TryMul).
Sourcefn try_div(self, rhs: Self) -> Result<Self, ValueError>
fn try_div(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::ops::Div, but fallible (e.g. TryDiv).
Sourcefn try_add(self, rhs: Self) -> Result<Self, ValueError>
fn try_add(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::ops::Add, but fallible (e.g. TryAdd).
Sourcefn try_sub(self, rhs: Self) -> Result<Self, ValueError>
fn try_sub(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::ops::Sub, but fallible (e.g. TrySub).
Sourcefn try_or(
self,
rhs: impl FnMut() -> Result<Self, ExpressionError>,
) -> Result<Self, ValueError>
fn try_or( self, rhs: impl FnMut() -> Result<Self, ExpressionError>, ) -> Result<Self, ValueError>
Try to “OR” (||) two values types.
If the lhs value is null or false, the rhs is evaluated and
returned. The rhs is a closure that can return an error, and thus this
method can return an error as well.
Sourcefn try_and(self, rhs: Self) -> Result<Self, ValueError>
fn try_and(self, rhs: Self) -> Result<Self, ValueError>
Try to “AND” (&&) two values types.
A lhs or rhs value of Null returns false.
Sourcefn try_rem(self, rhs: Self) -> Result<Self, ValueError>
fn try_rem(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::ops::Rem, but fallible (e.g. TryRem).
Sourcefn try_gt(self, rhs: Self) -> Result<Self, ValueError>
fn try_gt(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::cmp::Ord, but fallible (e.g. TryOrd).
Sourcefn try_ge(self, rhs: Self) -> Result<Self, ValueError>
fn try_ge(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::cmp::Ord, but fallible (e.g. TryOrd).
Sourcefn try_lt(self, rhs: Self) -> Result<Self, ValueError>
fn try_lt(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::cmp::Ord, but fallible (e.g. TryOrd).
Sourcefn try_le(self, rhs: Self) -> Result<Self, ValueError>
fn try_le(self, rhs: Self) -> Result<Self, ValueError>
Similar to std::cmp::Ord, but fallible (e.g. TryOrd).
fn try_merge(self, rhs: Self) -> Result<Self, ValueError>
Sourcefn eq_lossy(&self, rhs: &Self) -> bool
fn eq_lossy(&self, rhs: &Self) -> bool
Similar to std::cmp::Eq, but does a lossless comparison for integers
and floats.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.