#data-encoding #bare #serde #list

no-std serde_bare

An implementation of the BARE (https://baremessages.org) encoding format

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

#1072 in Encoding

Download history 3183/week @ 2024-07-30 3015/week @ 2024-08-06 2455/week @ 2024-08-13 2327/week @ 2024-08-20 3014/week @ 2024-08-27 3104/week @ 2024-09-03 3524/week @ 2024-09-10 3540/week @ 2024-09-17 3191/week @ 2024-09-24 3528/week @ 2024-10-01 3800/week @ 2024-10-08 3846/week @ 2024-10-15 4226/week @ 2024-10-22 2962/week @ 2024-10-29 2359/week @ 2024-11-05 3345/week @ 2024-11-12

13,725 downloads per month
Used in 61 crates (33 directly)

MIT/Apache

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

~100–330KB