serde-beve

Crates.ioserde-beve
lib.rsserde-beve
version1.0.0-alpha.3
created_at2025-06-18 08:57:29.959045+00
updated_at2025-06-20 07:15:55.825567+00
descriptionA BEVE data format for Serde
homepage
repositoryhttps://github.com/justdeeevin/serde-beve
max_upload_size
id1716768
size153,878
Devin Droddy (justDeeevin)

documentation

https://docs.rs/serde-beve

README

Serde BEVE

A Serde data format for BEVE.

16-bit floats

BEVE supports both f16s and brain floats. This crate supports the deserialization of both, converting them into f32s. However, similar to extension types, Serde provides no means of serializing these types, and as such their deserialization is gated by the half feature, which enables the use of the half crate for working with them.

Notes

Since BEVE is a binary format, this crate doesn't provide any tools for serializing to or deserializing from strings.

BEVE collections (arrays, object, and strings) store their lengths as compressed integers1. The compression method uses the first two bits to indicate the number of bytes in the integer, and as such, the maximum size is 62 bits2. If, for some reason, you have a string with more than that many bytes, an array with more than that many items, or (heaven forbid) a struct or map with more than that many fields, serialization will fail.

BEVE is a little-endian format, and for the sake of simplicity, this crate assumes it is being used on a little-endian system.

Footnotes

  1. https://github.com/beve-org/beve?tab=readme-ov-file#compressed-unsigned-integer

  2. (2^62) - 1 = 4611686018427387904

Commit count: 65

cargo fmt