- Rename the
bytevec_impls
macro tobytevec_decl
. This macro now accepts a pub access modifier on the declaredstruct
and on its fields. - Reintroduce the
bytevec_impls
macro. This macro now can do a partial or full implementation of the serialization and deserialization operations for an externally declaredstruct
. Partial implementation in this context meaning that it can be implemented for only a subset of the actual fields of thestruct
rather than for all the fields. The remaining fields will be obtained from the value returned fromDefault::default()
on deserialization. - Change the fixed u32 type for the size indicators used in the byte representation of a complex
structure. The methods of
ByteEncodable
andByteDecodable
now use an integral type parameterSize
constrained by theBVSize
trait. This trait is implemented foru8
,u16
,u32
andu64
. This now lifts the 4GB fixed limit of byte buffer, as the user now can useu64
for the size indicator. - Add a
decode_max
method to theByteDecodable
trait, so users are now able to set a limit to the length of byte buffer on deserialization. If the limit is less or equal than the buffer length, it will call and return the value returned fromdecode
, otherwise it will return aBadSizeDecodeError
. - Change endianness from big endian to little endian.
- Minor fix to correct wrong usage of a
BVExpectedSize
value.
- Introduce the
ByteEncodable
andByteDecodable
traits that provide methods for serialization and deserialization respectively. - Implementations of the
ByteEncodable
andByteDecodable
traits for most base types. - Introduce the
bytevec_impls
macro for customstruct
declarations that automatically implement theByteEncodable
andByteDecodable
traits. bytevec_impls
can only define private structs.- Big endian encoding for primitive data types.
- u32 fixed length for the size indicators.
- Max 4GB fixed limit.