Derive Macro neli_proc_macros::FromBytesWithInput
source · [−]#[derive(FromBytesWithInput)]
{
// Attributes available to this derive:
#[neli]
}
Expand description
Derives the neli FromBytesWithInput
trait for a struct.
Acceptable struct attribute is:
#[neli(from_bytes_bound = "T: MyTrait")]
which will generate a trait bound in the impl for the specified type parameter.#[neli(padding)]
which will add special handling for padding for this struct.
Acceptable field attribute forms are:
#[neli(input = "input_expression")]
which may only be used once for a struct. The behavior of this attribute is that a bound requirement will change from the implicitFromBytes
to an implicitFromBytesWithInput
bound. The method in this trait will be called withinput_expression
as the input provided.#[neli(input)]
which will transparently pass the input provided in theFromBytesWithInput
method through to theFromBytesWithInput
method for this field unchanged according to the rules described above.#[neli(size = "size_var_name")]
which allows specifying a size of the data type that is different from the input specified by#[neli(input)]
. Not specifying this attribute defaults to usinginput
as the size as well.
Implicit type parameter bound: FromBytes
.