CBOR (RFC 8949) implementation, with a Serde adapter
HEALTH ? 75 / Stable
CBOR (RFC 8949) implementation, with a Serde adapter
// readme
Implementation of the CBOR data format. Serde bridge and native derive (optional).
Compatible with WASM.
Complies to the following RFCs:
Here: https://docs.rs/seabored
Not great as of now, will get better in subsequent releases.
If you want examples, please head to the benches folder.
With the derive feature, the native traits can be derived without going through
Serde. Attributes are under #[cbor(...)].
use seabored::de::from_bytes;
use seabored::ser::CborSerialize;
#[derive(Debug, PartialEq, seabored::CborSerialize, seabored::CborDeserialize)]
struct Record {
id: u32,
#[cbor(key = "payload", tag = 24)]
payload: Vec<u8>,
#[cbor(skip, default)]
cache: u64,
}
let bytes = Record { id: 1, payload: vec![1, 2],โฆ