Skip to main content

Arithmetic

Trait Arithmetic 

Source
pub trait Arithmetic: Expression
where Self::Output: Numeric,
{ // Provided methods fn add<R>(self, rhs: R) -> ArithExpr<Self, R, Add> where R: Expression, R::Output: Numeric { ... } fn sub<R>(self, rhs: R) -> ArithExpr<Self, R, Sub> where R: Expression, R::Output: Numeric { ... } fn mul<R>(self, rhs: R) -> ArithExpr<Self, R, Mul> where R: Expression, R::Output: Numeric { ... } fn div<R>(self, rhs: R) -> ArithExpr<Self, R, Div> where R: Expression, R::Output: Numeric { ... } fn modulo<R>(self, rhs: R) -> ArithExpr<Self, R, Mod> where R: Expression, R::Output: Numeric { ... } }
Expand description

Trait for arithmetic operations

Provided Methods§

Source

fn add<R>(self, rhs: R) -> ArithExpr<Self, R, Add>
where R: Expression, R::Output: Numeric,

Source

fn sub<R>(self, rhs: R) -> ArithExpr<Self, R, Sub>
where R: Expression, R::Output: Numeric,

Source

fn mul<R>(self, rhs: R) -> ArithExpr<Self, R, Mul>
where R: Expression, R::Output: Numeric,

Source

fn div<R>(self, rhs: R) -> ArithExpr<Self, R, Div>
where R: Expression, R::Output: Numeric,

Source

fn modulo<R>(self, rhs: R) -> ArithExpr<Self, R, Mod>
where R: Expression, R::Output: Numeric,

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§

Source§

impl<E: Expression> Arithmetic for E
where E::Output: Numeric,