github anza-xyz/solana-sdk zero-copy@v1.0.0

latest releases: program-option@v3.1.0, address@v2.4.0, nullable@v1.0.0...
14 hours ago

What's new

solana-zero-copy is the new home for zero-copy primitive wrappers previously developed inside spl-pod. It is a
no_std crate for stable-layout, unaligned primitive wrapper types used in Solana zero-copy data structures.

The reserved-null data structure has been split into the companion solana-nullable crate.

Migration notes

spl-pod will essentially be deprecated, but an upcoming patch release that will re-export from solana-zero-copy
in a backwards-compatible way.

Changes

If you are coming from spl-pod, here is the rough mapping:

Concept New home
Unaligned primitive wrappers solana-zero-copy
Reserved-null option semantics solana-nullable

Primitive wrappers are renamed as follows:

spl-pod solana-zero-copy
spl_pod::primitives::PodBool solana_zero_copy::unaligned::Bool
spl_pod::primitives::PodU16 solana_zero_copy::unaligned::U16
spl_pod::primitives::PodI16 solana_zero_copy::unaligned::I16
spl_pod::primitives::PodU32 solana_zero_copy::unaligned::U32
spl_pod::primitives::PodU64 solana_zero_copy::unaligned::U64
spl_pod::primitives::PodI64 solana_zero_copy::unaligned::I64
spl_pod::primitives::PodU128 solana_zero_copy::unaligned::U128

The old Pod* prefixes have been dropped in favor of shorter names scoped under the unaligned module.

Other key changes to be aware of:

  • U128 is unavailable on BPF targets
  • MaybeNull errors changed. Conversions return MaybeNullError instead of ProgramError
  • No crate re-exports. solana-address, solana-program-error, and solana-program-option are not re-exported and
    those respective crates have their own Nullable impl.

Don't miss a new solana-sdk release

NewReleases is sending notifications on new releases.