Skip to main content

ValuePod

Trait ValuePod 

Source
pub unsafe trait ValuePod: Sized + Copy { }
Expand description

Marker for Copy + Sized scalars/arrays that may be read by value from raw bytes with read_unaligned_value (alignment-independent).

§Safety

Unlike Pod, ValuePod does not permit forming a &T overlay, so it is safe to implement for native multi-byte integers. Use it for instruction-argument decoding and local scalar loads where the value is copied out, not referenced in place. Implementers assert every [u8; size_of::<T>()] bit pattern decodes to a valid T.

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 ValuePod for i8

Source§

impl ValuePod for i16

Source§

impl ValuePod for i32

Source§

impl ValuePod for i64

Source§

impl ValuePod for i128

Source§

impl ValuePod for u8

Source§

impl ValuePod for u16

Source§

impl ValuePod for u32

Source§

impl ValuePod for u64

Source§

impl ValuePod for u128

Source§

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

Implementors§