Skip to main content

Serialize

Derive Macro Serialize 

Source
#[derive(Serialize)]
{
    // Attributes available to this derive:
    #[pack_io]
}
Available on crate feature derive only.
Expand description

Derive pack_io::Serialize for a struct or enum.

Fields are encoded in their declaration order. For enums, a varint(variant_index) is emitted first, followed by the variant’s fields.

Each field type must already implement pack_io::Serialize.