Skip to main content

NsonDeserialize

Derive Macro NsonDeserialize 

Source
#[derive(NsonDeserialize)]
{
    // Attributes available to this derive:
    #[njson]
    #[nextjson]
    #[serde]
}
Available on crate feature derive only.
Expand description

Re-exports nextjson’s format-neutral serialization contracts.

NsonSerialize and NsonDeserialize are both traits and derive macros, so #[derive(rustbinary::NsonSerialize, rustbinary::NsonDeserialize)] works. Generated code refers to the ::nextjson crate, so applications must also depend on nextjson (the framework this codec is built on). Derive NextJson’s native decoding contract.

Configuration is accepted through #[njson(...)] (and, for migration convenience, #[serde(...)]). The generated implementation decodes through checked DecodeSlot state and uses normal Rust drop semantics for partially initialized fields.