pub trait Arithmetic: Sized {
// Required methods
fn add(&self, other: &Self) -> Result<Self>;
fn sub(&self, other: &Self) -> Result<Self>;
fn mul_scalar(&self, scalar: f64) -> Result<Self>;
fn div_scalar(&self, scalar: f64) -> Result<Self>;
}
Expand description
Trait for objects that support arithmetic operations
Required Methods§
Sourcefn mul_scalar(&self, scalar: f64) -> Result<Self>
fn mul_scalar(&self, scalar: f64) -> Result<Self>
Multiply by scalar
Sourcefn div_scalar(&self, scalar: f64) -> Result<Self>
fn div_scalar(&self, scalar: f64) -> Result<Self>
Divide by scalar
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.