zerocopy 0.2.0

Utilities for zero-copy parsing and serialization
Documentation

Utilities for safe zero-copy parsing and serialization.

This crate provides utilities which make it easy to perform zero-copy parsing and serialization by allowing zero-copy conversion to/from byte slices.

This is enabled by three core marker traits:

  • [FromBytes] indicates that a type may safely be converted from an arbitrary byte sequence
  • [AsBytes] indicates that a type may safely be converted to a byte sequence
  • [Unaligned] indicates that a type's alignment requirement is 1

Types which implement a subset of these traits can then be converted to/from byte sequences with little to no runtime overhead.