Skip to main content

AsPrimitive

Trait AsPrimitive 

Source
pub trait AsPrimitive: Sized {
    // Provided method
    fn as_<F: FromPrimitive<Self>>(self) -> F { ... }
}
Expand description

Trait for casting one primitive to another.

Provided Methods§

Source

fn as_<F: FromPrimitive<Self>>(self) -> F

Converts this primitive into the input primitive.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<U> AsPrimitive for U