NumericWeight

Trait NumericWeight 

Source
pub trait NumericWeight:
    Clone
    + Default
    + PartialOrd
    + Num
    + Zero
    + AddAssign
    + 'static { }
Expand description

Marker trait for numeric weight types.

Weight subsumption uses Rust’s From trait:

  • i32 → f64 is valid (From for f64 exists)
  • f64 → i32 is invalid (no lossless conversion)

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.

Implementors§

Source§

impl<T> NumericWeight for T
where T: Clone + Default + PartialOrd + Num + Zero + AddAssign + 'static,