Skip to main content

Projectable

Trait Projectable 

Source
pub unsafe trait Projectable: Copy + 'static { }
Expand description

Marker trait for types that can be safely projected from raw account data.

§Safety

The implementor must guarantee that:

  1. The type is #[repr(C)] (deterministic field ordering).
  2. The type is Copy (no drop glue, no interior mutability).
  3. Every bit pattern is valid (no padding-dependent invariants).
  4. No references or pointers (only plain data).

This is the same contract as bytemuck::Pod without the dependency.

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

Source§

impl Projectable for i16

Source§

impl Projectable for i32

Source§

impl Projectable for i64

Source§

impl Projectable for i128

Source§

impl Projectable for u8

Source§

impl Projectable for u16

Source§

impl Projectable for u32

Source§

impl Projectable for u64

Source§

impl Projectable for u128

Source§

impl Projectable for [u8; 32]

Source§

impl Projectable for [u8; 64]

Implementors§