Skip to content

Releases: serde-rs/serde

v0.8.0

28 Jul 06:26
v0.8.0
f12f640
Compare
Choose a tag to compare

This release contains significant breaking changes compared to v0.7.x.

Traits

  • The Serializer trait has been modified to allow for streaming serialization - serializing seq and map elements before knowing what the end of the seq or map will be. (#437)

  • Reduced boilerplate (no more SeqVisitor and MapVisitor) when implementing Serialize for most types.

    // OLD API
    struct MySeqVisitor { /* ... */ }
    impl /* pages of boilerplate */
    try!(serializer.serialize_seq(MySeqVisitor::new(iter, len)));
    
    // NEW API
    let mut state = try!(serializer.serialize_seq(len));
    for e in iter {
        try!(serializer.serialize_seq_elt(&mut state, e));
    }
    try!(serializer.serialize_seq_end(state));
  • The Serializer and Deserializer traits no longer provide default implementations for any methods. The old defaults were JSON-centric and inappropriate for most other formats. Every Serializer and Deserializer should mindfully implement all of the methods. (#437, #452)

Codegen

  • No more public dependency on Syntex. The serde_codegen::register function which was deprecated in v0.7.9 has been removed. Users should use serde_codegen::expand. See the readme for sample code, and see this forum topic for exposition. (#445)
  • Adjusted heuristic for generating bounds on generic type parameters (#456). This fixes a number of issues relating to bounds on recursive types, bounds involving references, and bounds involving private types (#435, #436, #441, #443)

Impls

  • The Deserialize impl for PhantomData<T> has been expanded to all T, not just T: Deserialize (#457, #459)
  • Add Deserialize impl for Box<str> (#454)

Nightly

  • The nightly feature has been renamed to unstable to align with community practices. (#404)

v0.7.15

26 Jul 16:37
v0.7.15
78e7488
Compare
Choose a tag to compare

(this release is a Syntex bump only)

v0.8.0-rc3

23 Jul 22:18
v0.8.0-rc3
e36f335
Compare
Choose a tag to compare
v0.8.0-rc3 Pre-release
Pre-release
Release 0.8.0-rc3

v0.8.0-rc2

18 Jul 01:26
v0.8.0-rc2
Compare
Choose a tag to compare
v0.8.0-rc2 Pre-release
Pre-release
Release 0.8.0-rc2

v0.8.0-rc1

17 Jul 18:52
v0.8.0-rc1
6fe01bc
Compare
Choose a tag to compare
v0.8.0-rc1 Pre-release
Pre-release
Release 0.8.0-rc1

v0.7.14

09 Jul 20:53
v0.7.14
Compare
Choose a tag to compare

(this release is a Syntex bump only)

v0.7.13

06 Jul 03:17
v0.7.13
97bc1e0
Compare
Choose a tag to compare
  • Excludes generated code from Clippy lints (rust-clippy#969)
  • Fixes the error code when deserializing a struct or enum from a seq of the wrong length (#421)

v0.7.12

03 Jul 16:01
v0.7.12
Compare
Choose a tag to compare

(this release is a Syntex bump only)

v0.7.11

24 Jun 03:05
v0.7.11
6ab508a
Compare
Choose a tag to compare
  • Better error when attempting to derive Deserialize for a struct containing &str (#378)
  • Error when a struct field has duplicate attributes (#355)
  • Serialize and Deserialize impls for tuples up to 16 elements (previously only up to 12 elements) (#387)

v0.7.10

11 Jun 20:15
v0.7.10
8a09f05
Compare
Choose a tag to compare
  • Adds Serialize and Deserialize support for HashMap and HashSet that use a non-default Hasher (#369)