pub trait QuantityUnit: 'static {
// Required methods
fn type_id() -> TypeId;
fn base_unit() -> &'static str;
// Provided method
fn allowed_suffixes() -> &'static [&'static str] { ... }
}Expand description
Marker trait describing the unit constraints of a Quantity.
Required Methods§
Provided Methods§
Sourcefn allowed_suffixes() -> &'static [&'static str]
fn allowed_suffixes() -> &'static [&'static str]
Suffixes accepted on input and rendered on output.
If empty, only QuantityUnit::base_unit is accepted. If non-empty,
only the listed suffixes are accepted, so include the base unit here if
it should remain valid.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".