#[derive(Epserde)]
{
// Attributes available to this derive:
#[zero_copy]
#[deep_copy]
}
Expand description
Generate an ε-serde implementation for custom types.
It generates implementations for the traits CopyType
,
MaxSizeOf
, TypeHash
, ReprHash
, SerializeInner
,
and DeserializeInner
.
Presently we do not support unions.
The attribute zero_copy
can be used to generate an implementation for a zero-copy
type, but the type must be repr(C)
and all fields must be zero-copy.
If you do not specify zero_copy
, the macro assumes your structure is deep-copy.
However, if you have a structure that could be zero-copy, but has no attribute,
a warning will be issued every time you serialize. The warning can be silenced adding
the explicity attribute deep_copy
.