CopyConstructable

Trait CopyConstructable 

Source
pub trait CopyConstructable: Copy { }
Expand description

Marker trait for types that can be trivially constructed by copying their underlying data. It can also be assumed, that the size of a CopyConstructable is the actual binary object size.

For types implementing this trait:

  • FromMemoryView is automatically implemented.
  • The associated [DecodeError] is fixed to Infallible, since decoding cannot fail.

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.

Implementations on Foreign Types§

Source§

impl CopyConstructable for f32

Source§

impl CopyConstructable for f64

Source§

impl CopyConstructable for i8

Source§

impl CopyConstructable for i16

Source§

impl CopyConstructable for i32

Source§

impl CopyConstructable for i64

Source§

impl CopyConstructable for u8

Source§

impl CopyConstructable for u16

Source§

impl CopyConstructable for u32

Source§

impl CopyConstructable for u64

Source§

impl<T1: CopyConstructable, T2: CopyConstructable> CopyConstructable for (T1, T2)

Source§

impl<T: CopyConstructable, const N: usize> CopyConstructable for [T; N]

Implementors§