pub trait MulByScalar<Rhs, Out = Self>: Sized {
// Required method
fn mul_by_scalar<const CHECK: bool>(self, rhs: &Rhs) -> Option<Out>;
}Expand description
Multiplication of an element by a scalar of a (possibly) different type. This multiplication can widen the result.
Note that this is for static semirings only, dynamic fields don’t go through this route.
Required Methods§
Sourcefn mul_by_scalar<const CHECK: bool>(self, rhs: &Rhs) -> Option<Out>
fn mul_by_scalar<const CHECK: bool>(self, rhs: &Rhs) -> Option<Out>
Multiplies self by a scalar from the right (usually - a coefficient to
obtain a linear combination).
Returns None if the multiplication would overflow.
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.