#bare #serde #data-encoding #no-std

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

#856 in Encoding

Download history 6975/week @ 2023-11-23 7358/week @ 2023-11-30 7623/week @ 2023-12-07 7517/week @ 2023-12-14 6498/week @ 2023-12-21 6787/week @ 2023-12-28 7109/week @ 2024-01-04 6772/week @ 2024-01-11 7393/week @ 2024-01-18 7329/week @ 2024-01-25 6284/week @ 2024-02-01 6718/week @ 2024-02-08 6312/week @ 2024-02-15 6091/week @ 2024-02-22 5578/week @ 2024-02-29 3809/week @ 2024-03-07

22,878 downloads per month
Used in 49 crates (23 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

~110–350KB