Skip to content

Releases: Nukesor/inter-struct

v0.2.1

16 Dec 00:22
d797670
Compare
Choose a tag to compare

[0.2.1] - 16-12-2023

Misc

  • Bump syn dependency to v2.

v0.2.0

16 Dec 00:16
36aff80
Compare
Choose a tag to compare

[0.2.0] - 31-05-2022

Changed

  • Refactor structure of public API and rename derive macros.

v0.1.0

06 Apr 07:58
2a8f33b
Compare
Choose a tag to compare

[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 into Self.
  • StructMergeInto trait.
    The counterpart of StructMerge which merges Self into a target struct.
    StructMerge is automatically implemented.
  • StructMergeRef trait which implements functions to merge a reference of given struct into Self.
    The fields to be merged then need to implement Clone.
  • StructMergeIntoRef trait.
    The counterpart of StructMergeRef, 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 generating StructMergeInto and the auto-implemented StructMerge implementations.
  • merge_ref attribute for generating the StructMergeRefInto and the auto-implemented StructMergeRef implementations.
  • into attribute for generating std::convert::From and the auto-implemented std::convert::Into implementations.
  • into_default attribute for generating std::convert::From and the auto-implemented std::convert::Into implementations.
    This populates all non-matching fields by calling Default::default for the target struct.