//! Zero-copy serialization utilities.
use Bytes;
/// Marker trait for metadata structures that can be safely written to and
/// read from bytes.
///
/// Types implementing this trait satisfy the requirements from `zerocopy` and
/// `anybytes` for zero-copy serialization. It is automatically implemented for
/// any type that implements the necessary `zerocopy` traits.
/// Types that can be reconstructed from frozen [`Bytes`] using metadata.
///
/// Implementors write their data into a [`ByteArea`](anybytes::ByteArea) and
/// expose lightweight metadata that describes where their bytes live. Given
/// the metadata and the full `Bytes` region, the type can be rebuilt without
/// copying.