Skip to main content

ic_wire/serde_packed/
mod.rs

1//! Explicit Serde field adapters for domain containers using [`crate::Packed`] bytes.
2//!
3//! Select with `#[serde(with = "ic_wire::serde_packed::nonzero_i64")]` or
4//! `#[serde(with = "ic_wire::serde_packed::heap_u64")]`. Encoding borrows existing
5//! storage on little-endian hosts; decoding remains owned. Wire's metadata derive
6//! recognizes these exact paths (also with a leading `::`).
7//!
8//! Adoption changes ordinary list bytes and traversal admission: `[-1]` as
9//! `Vec<NonZeroI64>` changes from `01 01` to `08 ff ff ff ff ff ff ff ff`;
10//! heap `[1]` changes from `01 01` to `08 01 00 00 00 00 00 00 00`.
11//! Coordinate contract identities and consumers, regenerate clients and requalify
12//! limits. Existing ordinary lists and `Packed` bytes/acceptance are unchanged.
13//! Field adapters can charge less encoding allowance than an equivalent `Packed`
14//! wrapper because Serde passes a reference-sized adapter to the parent serializer.
15//! Neither representation guarantees canonical heap order: retain original bytes
16//! when retries or signatures depend on them.
17
18pub mod heap_u64;
19pub mod nonzero_i64;