pub trait Unit {
type Dimension;
// Required method
fn parameters() -> UnitParameters;
// Provided methods
fn to<S: Unit<Dimension = Self::Dimension>, E: TensorElement>(value: E) -> E { ... }
fn from<S: Unit<Dimension = Self::Dimension>, E: TensorElement>(
value: E,
) -> E { ... }
fn to_base(value: c64) -> c64 { ... }
fn from_base(value: c64) -> c64 { ... }
fn symbol() -> &'static str { ... }
fn name() -> &'static str { ... }
fn ratio<T: Unit<Dimension = Self::Dimension>>() -> f64 { ... }
}Required Associated Types§
Required Methods§
fn parameters() -> UnitParameters
Provided Methods§
fn to<S: Unit<Dimension = Self::Dimension>, E: TensorElement>(value: E) -> E
fn from<S: Unit<Dimension = Self::Dimension>, E: TensorElement>(value: E) -> E
fn to_base(value: c64) -> c64
fn from_base(value: c64) -> c64
fn symbol() -> &'static str
fn name() -> &'static str
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.