acir::serialization

Function msgpack_serialize

Source
pub(crate) fn msgpack_serialize<T: Serialize>(
    value: &T,
    compact: bool,
) -> Result<Vec<u8>>
Expand description

Serialize a value using MessagePack, based on serde.

This format is compact can be configured to be backwards compatible.

When compact is true, it serializes structs as tuples, otherwise it writes their field names. Enums are always serialized with their variant names (despite what the library comments say, and it’s not configurable).

Set compact to true if we want old readers to fail when a new field is added to a struct, that is, if we think that ignoring a new field could lead to incorrect behavior.