Registry / serialization / borsh-derive

borsh-derive

JSON →
library1.6.1rscratesunverified

Derive macros for the Borsh binary serialization format, enabling automatic serialization and deserialization of Rust structs and enums.

# Cargo.toml [dependencies] borsh-derive = "1.6.1"
INSTALL
IMPORT
SIG · BORSH-DERIVE
B
borsh-derive
serializationrustv1.6.1
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.

BorshSerialize
use borsh::BorshSerialize;

Defines a struct with Borsh serialization derives, serializes it to bytes, and deserializes back.

use borsh::{BorshSerialize, BorshDeserialize}; #[derive(BorshSerialize, BorshDeserialize, Debug)] struct MyStruct { x: u32, y: String, } fn main() { let original = MyStruct { x: 42, y: "hello".into() }; let bytes = borsh::to_vec(&original).unwrap(); let deserialized: MyStruct = borsh::from_slice(&bytes).unwrap(); println!("{:?}", deserialized); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.6.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
borsh-derive — cargo add borsh-derive · libregistry