6 releases (breaking)
0.5.0 | Sep 28, 2021 |
---|---|
0.4.0 | Apr 12, 2021 |
0.3.0 | Jul 17, 2020 |
0.2.0 | Jul 9, 2020 |
0.1.1 | Jun 20, 2020 |
#1058 in Encoding
14,892 downloads per month
Used in 61 crates
(34 directly)
49KB
1.5K
SLoC
serde_bare
An implementation of the BARE (https://baremessages.org) encoding format draft.
Mailing list: https://lists.sr.ht/~tdeo/serde_bare Ticket tracker: https://todo.sr.ht/~tdeo/serde_bare
To run benchmarks on your system:
cd benches
make bench
Or to run the reference Go benchmarks as well:
cd benches
make bench-all
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
serde_bare
An implementation of the BARE (https://baremessages.org) encoding format draft.
Mapping from the Serde data model
bool
, i8
through i64
, u8
through u64
, f32
, f64
, string
Serialize as the BARE types of the same name.
i128
, u128
Serialize as data<16>
.
char
Serializes as u32
.
byte array
Serializes as data
.
option
Serializes as optional<type>
seq
Serializes as []type
.
Sequences with unknown lengths are not representable in BARE.
map
Serializes as map[type]type
.
unit
Serializes as void
.
unit_struct
Serializes as void
.
The container name is ignored.
unit_variant
Serialized as the variant index as a uint
followed by the variant data.
The container name and variant name are ignored.
newtype_struct
Serialized the same as the contained type. The container name is ignored.
newtype_variant
Serialized as the variant index as a uint
followed by the variant data.
The container name and variant name are ignored.
tuple
Serialized as struct
.
tuple_struct
Serialized as struct
.
The container name is ignored.
tuple_variant
Serialized as the variant index as a uint
followed by the variant data.
The container name and variant name are ignored.
struct
Serialized as struct
.
struct_variant
Serialized as a uint
followed by the variant data.
The container name and variant name are ignored.
Dependencies
~105–330KB