3 releases

0.1.0 Feb 4, 2022
0.1.0-dev.2 Dec 31, 2021
0.1.0-dev.1 Dec 29, 2021

#2133 in Encoding

Download history 83/week @ 2023-12-03 49/week @ 2024-01-28 4/week @ 2024-02-18 24/week @ 2024-02-25 8/week @ 2024-03-03 22/week @ 2024-03-10 79/week @ 2024-03-17

133 downloads per month
Used in 3 crates

MIT/Apache

54KB
1K SLoC

transmog-bincode

Transmog implementation of the Bincode format.

transmog-bincode forbids unsafe code crate version Documentation for main branch

This crate provides a Format trait implementation using the Bincode type:

use transmog::{Format, OwnedDeserializer};
use transmog_bincode::Bincode;

let bincode = Bincode::default();
let serialized = bincode.serialize(&42_u64).unwrap();
let deserialized: u64 = bincode.deserialize_owned(&serialized).unwrap();
assert_eq!(deserialized, 42);

Bincode::default() returns an instance configured to be equivalent to using bincode::DefaultOptions. If you're working with existing data that used the global serialization/deserialization methods, use Bincode::legacy_default() instead:

use transmog::{Format, OwnedDeserializer};
use transmog_bincode::Bincode;

let bincode = Bincode::legacy_default();
let serialized = bincode.serialize(&42_u64).unwrap();
let deserialized: u64 = bincode.deserialize_owned(&serialized).unwrap();
assert_eq!(deserialized, 42);

Bincode offers all configuration options bincode exposes.

Open-source Licenses

This project, like all projects from Khonsu Labs, are open-source. This repository is available under the MIT License or the Apache License 2.0.

To learn more about contributing, please see CONTRIBUTING.md.

Dependencies

~335–590KB
~14K SLoC