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//! [`bools`] provides the same explicit selection for `Vec<bool>`, with checked
8//! byte-buffer decoding and `boolean[]` browser values on every endian target.
9//! [`finite_f32`] and [`finite_f64`] explicitly encode primitive float vectors
10//! as finite little-endian words, with typed-array browser values. They reject
11//! NaNs/infinities before decode allocation and preserve signed zero/subnormals.
12//! A singleton f32 prefix changes from `01` to `04`; f64 changes `01` to `08`.
13//! Preserve consumer field bounds and regenerate clients before adoption.
14//!
15//! Adoption changes ordinary list bytes and traversal admission: `[-1]` as
16//! `Vec<NonZeroI64>` changes from `01 01` to `08 ff ff ff ff ff ff ff ff`;
17//! heap `[1]` changes from `01 01` to `08 01 00 00 00 00 00 00 00`.
18//! Bool list bytes stay identical (`02 00 01` for `[false, true]`), while their
19//! traversal admission changes to one buffer. Existing lists are never rewritten.
20//! Coordinate contract identities and consumers, regenerate clients and requalify
21//! limits. Existing ordinary lists and `Packed` bytes/acceptance are unchanged.
22//! Field adapters can charge less encoding allowance than an equivalent `Packed`
23//! wrapper because Serde passes a reference-sized adapter to the parent serializer.
24//! Neither representation guarantees canonical heap order: retain original bytes
25//! when retries or signatures depend on them.
26
27pub mod bools;
28mod finite;
29pub mod finite_f32;
30pub mod finite_f64;
31pub mod heap_u64;
32pub mod nonzero_i64;