VrlValueArithmetic

Trait VrlValueArithmetic 

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

Source

fn try_mul(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::ops::Mul, but fallible (e.g. TryMul).

Source

fn try_div(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::ops::Div, but fallible (e.g. TryDiv).

Source

fn try_add(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::ops::Add, but fallible (e.g. TryAdd).

Source

fn try_sub(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::ops::Sub, but fallible (e.g. TrySub).

Source

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.

Source

fn try_and(self, rhs: Self) -> Result<Self, ValueError>

Try to “AND” (&&) two values types.

A lhs or rhs value of Null returns false.

Source

fn try_rem(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::ops::Rem, but fallible (e.g. TryRem).

Source

fn try_gt(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::cmp::Ord, but fallible (e.g. TryOrd).

Source

fn try_ge(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::cmp::Ord, but fallible (e.g. TryOrd).

Source

fn try_lt(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::cmp::Ord, but fallible (e.g. TryOrd).

Source

fn try_le(self, rhs: Self) -> Result<Self, ValueError>

Similar to std::cmp::Ord, but fallible (e.g. TryOrd).

Source

fn try_merge(self, rhs: Self) -> Result<Self, ValueError>

Source

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.

Implementors§