Expand description
Procedural macros to be used with the library
neli.
All derive macros other than Header generate implicit type
parameter bounds on every type parameter which can be overriden
with struct attributes.
Attribute Macros§
- neli_
enum - Converts an enum from the form:
Derive Macros§
- From
Bytes - Derives the neli
FromBytestrait for a struct. - From
Bytes With Input - Derives the neli
FromBytesWithInputtrait for a struct. - Header
- Derives the neli
Headertrait for a struct or enum. Unlike other derive macros in this crate, theHeaderderive macro does not impose type parameter bounds on type parameters. See the accepted attribute for more information. The reason for this is that the last field is considered to be the payload. Because the payload may be represented by a type parameter, we cannot blindly restrict type parameters or else we impose an artificial restriction ofTypeSizeon the payload type parameter. This is a problem for theHeadertrait as the payload may be unsized even if the rest of the header is composed exclusively of statically sized types and are therefore compatible with theTypeSizetrait. - Size
- Derives the neli
Sizetrait for a struct or enum. - ToBytes
- Derives the neli
ToBytestrait for a struct or enum.