#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

#1058 in Encoding

Download history 3290/week @ 2024-07-19 3520/week @ 2024-07-26 3118/week @ 2024-08-02 2774/week @ 2024-08-09 2366/week @ 2024-08-16 2368/week @ 2024-08-23 3082/week @ 2024-08-30 3485/week @ 2024-09-06 3511/week @ 2024-09-13 3521/week @ 2024-09-20 3402/week @ 2024-09-27 3442/week @ 2024-10-04 3835/week @ 2024-10-11 4537/week @ 2024-10-18 3388/week @ 2024-10-25 2545/week @ 2024-11-01

14,892 downloads per month
Used in 61 crates (34 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

~105–330KB