Registry / serialization / serde-cbor

serde-cbor

JSON →
library0.11.2rscratesunverified

CBOR (Concise Binary Object Representation) support for the Serde serialization framework.

# Cargo.toml [dependencies] serde_cbor = "0.11.2"
INSTALL
IMPORT
SIG · SERDE-CBOR
S
serde-cbor
serializationrustv0.11.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from_slice
use serde_cbor::from_slice;

Deserialize a CBOR byte slice into a Rust struct using Serde.

use serde_cbor::from_slice; use serde::Deserialize; #[derive(Deserialize, Debug)] struct Data { name: String, age: u32, } let bytes = b"\xa2\x64name\x65Alice\x63age\x18\x1e"; let data: Data = from_slice(bytes).unwrap(); println!("{:?}", data);
Debug
Known issues
gotchaCBOR is a binary format; ensure you have the correct byte order and encoding.
fix
Use `serde_cbor::to_vec` for serialization and `from_slice` for deserialization.
affects: >=0.11.0
Upgrade
Version history
0.11.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
serde-cbor — cargo add serde-cbor · libregistry