4 releases (2 breaking)

0.3.1 Sep 19, 2021
0.3.0 Sep 19, 2021
0.2.0 Sep 17, 2021
0.1.0 Sep 16, 2021

#2878 in Parser implementations

Custom license

32KB
930 lines

Soni's Serde Utilities

This crate provides some utilities for use with serde.

Currently, it provides MayBe<T>, a deserializable that doesn't error if something doesn't match a T. For example, it enables the JSON:

{
  "bar": []
}

to successfully deserialize into the Rust struct:

#[derive(Deserialize)]
struct Foo {
  bar: MayBe<f64>,
}

as a foo.bar.is_not().


lib.rs:

Soni's Serde Utilities.

This crate provides some utilities for use with serde.

Dependencies

~0.4–1MB
~24K SLoC