Skip to content

Releases: lowRISC/serde-annotate

v0.0.12

22 Apr 15:58
Compare
Choose a tag to compare
v0.0.12 Pre-release
Pre-release
Eliminate use of nightly feature `min_specialization`.

The `min_specialization` feature is only available in nightly and
doesn't seem to be making progress towards becoming a supported language
feature.

What is necessary to support serde-annotate is to be able to get a
reference to the `dyn Annotate` implementation.  With
`min_specialization`, this was done by implementing a default `Annotate`
for all `T: Serialize` and then specialzing `Annotate` on types with
specific annotators.  This generally worked, but it did cause some
problems around `erased_serde::Serialize` as any type information about
the type was erased.

What is really required to implement annotations is to be able to look
up the Annotators for a given type.  The serde serializer actually helps
with this:  The serialize functions for structs and enums accept a
`name` parameter which is the typename of the item being serialized.
Instead of using `min_specialization`, we build a database mapping
typenames to casting functions that can cast a pointer to the
appropriate `dyn Annotate` reference.

1. Simplify the `Annotate` trait to only include the format and comment
   annotations.
2. Update the derive macro to only implement format/comment.  Use the
   `inventory` crate to register the name to annotator-cast functions.
3. Update tests.

Signed-off-by: Chris Frantz <frantzcj@gmail.com>

v0.0.11

26 Mar 22:10
Compare
Choose a tag to compare

What's Changed

  • Bugfix: count value-containing document nodes by @cfrantz in #21
  • Re-organize project workspace by @cfrantz in #22

Full Changelog: v0.0.9...v0.0.11

v0.0.10

21 Mar 02:58
Compare
Choose a tag to compare

What's Changed

  • Bugfix: count value-containing document nodes by @cfrantz in #21

Full Changelog: v0.0.9...v0.0.10

Release 0.0.9

30 Oct 23:15
Compare
Choose a tag to compare

Updates to various crate dependencies.

Release 0.0.8

22 May 16:29
Compare
Choose a tag to compare

Add a deserialize_any implementation to handle serde(untagged) enums.

Release 0.0.7

13 Feb 17:28
Compare
Choose a tag to compare

Update the bazel build to use crate_universe from rules_rust instead of cargo_raze.

v0.0.6

03 Nov 16:27
Compare
Choose a tag to compare
  • Disable comments for NewType structs and Unit Variants
  • Add specialization for reference-to-type
  • Expose the integer::Base enum

v0.0.5

02 Nov 00:07
Compare
Choose a tag to compare
  • Fix the proc-macro for unit variants.

v0.0.4

31 Oct 21:16
Compare
Choose a tag to compare
  • Support partial serialization & deserialization
  • Fix serializing Option and NewType structs

v0.0.3

29 Sep 03:07
Compare
Choose a tag to compare
  • Use min_specialization to provide the Annotate trait without type-id hacks.
  • Implement type erasure on dyn Annotate.