pina_pod_primitives
Alignment-safe primitive POD wrappers used by Pina and generated Codama Rust clients.
This crate provides PodBool, PodU16, PodI16, PodU32, PodI32, PodU64, PodI64, PodU128, and PodI128 for use in #[repr(C)] zero-copy layouts.
Arithmetic
Arithmetic operators (+, -, *) use wrapping semantics in release builds for CU efficiency and panic on overflow in debug builds. Use checked_add, checked_sub, checked_mul, checked_div where overflow must be detected in all build profiles.
Each Pod integer type provides ZERO, MIN, and MAX constants.
Installation
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.