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:
StructMerge
trait which implements functions to merge a given struct intoSelf
.StructMergeInto
trait.
The counterpart ofStructMerge
which mergesSelf
into a target struct.
StructMerge
is automatically implemented.StructMergeRef
trait which implements functions to merge a reference of given struct intoSelf
.
The fields to be merged then need to implementClone
.StructMergeIntoRef
trait.
The counterpart ofStructMergeRef
, which merges&Self
into a target struct.
StructMergeRef
is automatically implemented.
Derive Macro:
InterStruct
The main derive macro for this crate.
Derive Macro Attributes:
merge
attribute for generatingStructMergeInto
and the auto-implementedStructMerge
implementations.merge_ref
attribute for generating theStructMergeRefInto
and the auto-implementedStructMergeRef
implementations.into
attribute for generatingstd::convert::From
and the auto-implementedstd::convert::Into
implementations.into_default
attribute for generatingstd::convert::From
and the auto-implementedstd::convert::Into
implementations.
This populates all non-matching fields by callingDefault::default
for the target struct.