pub trait Scalar:
Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ Neg<Output = Self>
+ PartialOrd
+ Debug
+ Copy
+ 'static {
// Required methods
fn zero() -> Self;
fn one() -> Self;
fn from_usize(n: usize) -> Self;
}Expand description
A scalar type suitable for arc-length, parameter, and distance computations.
Requires arithmetic operations (Add, Sub, Mul, Div, Neg),
PartialOrd, Debug, Copy, and 'static bounds.
Manual implementations are provided for f32 and f64.
Required Methods§
Sourcefn from_usize(n: usize) -> Self
fn from_usize(n: usize) -> Self
Cast a usize value to this scalar type.
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.