Skip to main content

Crate layline_derive

Crate layline_derive 

Source
Expand description

Derive macros for layline: Layout, Message, FieldCodec and Dispatch.

Each attribute, and each key inside it, may appear once. A rejected type still implements its trait, so the build reports only the real error.

Derive Macrosยง

Dispatch
Derives Dispatch for an enum of Layout payloads selected by an id.
FieldCodec
Derives FieldCodec and WireInt for an integer newtype or an enum of named values, and FieldCodec for a group of bit fields.
Layout
Derives Layout for a fixed-size struct.
Message
Derives Message for a variable-size struct or enum, or Choice for an enum that #[switch] selects.