Skip to main content

Primitive

Trait Primitive 

Source
pub trait Primitive:
    Copy
    + Default
    + PartialEq
    + 'static { }
Expand description

Trait for types valid as primitive, i.e.., floats, integers, and booleans.

Useful when specifying my_fn::<T: Primitive>() {}.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Primitive for bool

Source§

impl Primitive for f32

Source§

impl Primitive for f64

Source§

impl Primitive for i8

Source§

impl Primitive for i16

Source§

impl Primitive for i32

Source§

impl Primitive for i64

Source§

impl Primitive for u8

Source§

impl Primitive for u16

Source§

impl Primitive for u32

Source§

impl Primitive for u64

Implementors§