pina_pod_primitives 0.6.0

Alignment-safe POD primitive wrappers for Solana account layouts
Documentation

pina_pod_primitives

Alignment-safe primitive POD wrappers used by Pina and generated Codama Rust clients.

Crates.io Docs.rs CI License codecov

This crate provides PodBool, PodU16, PodI16, PodU32, PodI32, PodU64, PodI64, PodU128, and PodI128 for use in #[repr(C)] zero-copy layouts.

Installation

cargo add pina_pod_primitives

Types

Type Wraps Size
PodBool bool 1 byte
PodU16 u16 2 bytes
PodI16 i16 2 bytes
PodU32 u32 4 bytes
PodI32 i32 4 bytes
PodU64 u64 8 bytes
PodI64 i64 8 bytes
PodU128 u128 16 bytes
PodI128 i128 16 bytes

All types are #[repr(transparent)] over byte arrays (or u8 for PodBool) and implement bytemuck::Pod + bytemuck::Zeroable.