pub trait NumericConversion<T> {
// Required methods
fn try_convert(self) -> Option<T>;
fn convert_or(self, default: T) -> T;
fn convert(self) -> T;
}
Expand description
Conversion between different numeric types
Required Methods§
Sourcefn try_convert(self) -> Option<T>
fn try_convert(self) -> Option<T>
Try to convert to the target type
Sourcefn convert_or(self, default: T) -> T
fn convert_or(self, default: T) -> T
Convert to the target type, or a default value if conversion fails
Implementors§
impl<F, T> NumericConversion<T> for F
Implement NumericConversion for all types that implement NumCast