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
FromBytes
trait for a struct. - From
Bytes With Input - Derives the neli
FromBytesWithInput
trait for a struct. - Header
- Derives the neli
Header
trait for a struct or enum. Unlike other derive macros in this crate, theHeader
derive 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 ofTypeSize
on the payload type parameter. This is a problem for theHeader
trait 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 theTypeSize
trait. - Size
- Derives the neli
Size
trait for a struct or enum. - ToBytes
- Derives the neli
ToBytes
trait for a struct or enum.