#serde #bare

serde_bare

An implementation of the BARE (https://git.sr.ht/~sircmpwn/bare) encoding format

5 releases (3 breaking)

0.4.0 Apr 12, 2021
0.3.0 Jul 17, 2020
0.2.0 Jul 9, 2020
0.1.1 Jun 20, 2020
0.1.0 Jun 20, 2020

#129 in Encoding

Download history 353/week @ 2021-01-16 358/week @ 2021-01-23 673/week @ 2021-01-30 743/week @ 2021-02-06 895/week @ 2021-02-13 1006/week @ 2021-02-20 909/week @ 2021-02-27 474/week @ 2021-03-06 719/week @ 2021-03-13 1029/week @ 2021-03-20 1930/week @ 2021-03-27 2313/week @ 2021-04-03 3715/week @ 2021-04-10 2390/week @ 2021-04-17 1335/week @ 2021-04-24 6017/week @ 2021-05-01

3,936 downloads per month
Used in 7 crates (5 directly)

MIT/Apache

41KB
1K 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:

make bench

Or to run the reference Go benchmarks as well:

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

~150–270KB