Crates.io | serde-beve |
lib.rs | serde-beve |
version | 1.0.0-alpha.3 |
created_at | 2025-06-18 08:57:29.959045+00 |
updated_at | 2025-06-20 07:15:55.825567+00 |
description | A BEVE data format for Serde |
homepage | |
repository | https://github.com/justdeeevin/serde-beve |
max_upload_size | |
id | 1716768 |
size | 153,878 |
A Serde data format for BEVE.
BEVE supports both f16
s and brain floats. This crate supports the deserialization of both, converting them into f32
s. 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.
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.
https://github.com/beve-org/beve?tab=readme-ov-file#compressed-unsigned-integer ↩
(2^62) - 1 = 4611686018427387904 ↩