pub trait BigCast: Sized + ToPrimitive {
// Required method
fn from<T: ToPrimitive>(n: T) -> Option<Self>;
}Expand description
Checked numeric casts up to and including i256 support.
This is meant as a more inclusive version of NumCast from the num-traits crate.
Required Methods§
Sourcefn from<T: ToPrimitive>(n: T) -> Option<Self>
fn from<T: ToPrimitive>(n: T) -> Option<Self>
Cast the value n to Self using the relevant ToPrimitive method. If the value cannot
be represented by Self, None is returned.
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.