Releases: Nukesor/inter-struct
Releases · Nukesor/inter-struct
v0.2.1
v0.2.0
v0.1.0
[0.1.0] - 30-12-2021
This is the first MVP release of the inter-struct library.
It's purpose is to implement traits between various structs.
Added
Traits:
StructMergetrait which implements functions to merge a given struct intoSelf.StructMergeIntotrait.
The counterpart ofStructMergewhich mergesSelfinto a target struct.
StructMergeis automatically implemented.StructMergeReftrait which implements functions to merge a reference of given struct intoSelf.
The fields to be merged then need to implementClone.StructMergeIntoReftrait.
The counterpart ofStructMergeRef, which merges&Selfinto a target struct.
StructMergeRefis automatically implemented.
Derive Macro:
InterStructThe main derive macro for this crate.
Derive Macro Attributes:
mergeattribute for generatingStructMergeIntoand the auto-implementedStructMergeimplementations.merge_refattribute for generating theStructMergeRefIntoand the auto-implementedStructMergeRefimplementations.intoattribute for generatingstd::convert::Fromand the auto-implementedstd::convert::Intoimplementations.into_defaultattribute for generatingstd::convert::Fromand the auto-implementedstd::convert::Intoimplementations.
This populates all non-matching fields by callingDefault::defaultfor the target struct.