msgpackin
Msgpackin pure Rust MessagePack encoding / decoding library.
Msgpackin supports no_std, but requires the alloc crate.
If you're looking for no alloc support, see the msgpackin_core crate.
Msgpackin supports serde with the serde feature in either no_std
or std mode. If you want std mode, you must also enable the
serde_std feature, as a temporary workaround until weak dependency
features are stablized.
Roadmap
- Value / ValueRef encoding and decoding without serde
- zero-copy string/binary/ext data with
from_ref -
no_stdserde support -
std::io::{Read, Write}support instdmode - Async IO support via
futures-ioortokiofeatures - recursion depth checking (the config is currently a stub)
- hooks for managed encoding / decoding of ext types
(e.g. Timestamp (
-1)) - benchmarking / optimization
Features
std- enabled by default, pulls in the rust std library, enabling encoding and decoding viastd::io::{Read, Write}traitsserde- enables serialization / deserialization through theserdecratefutures-io- enables async encoding and decoding through the futuresio::{AsyncRead, AsyncWrite}traitstokio- enables async encoding and decoding through the tokioio::{AsyncRead, AsyncWrite}traits
no_std Example
use *;
let expect = Map;
let encoded = expect.to_bytes.unwrap;
let decoded = from_ref.unwrap;
assert_eq!;
std Example
use *;
let expect = Map;
let mut buf = Vecnew;
let reader: = Boxnew;
let decoded = from_sync.unwrap;
assert_eq!;
Async Example
use *;
let expect = Map;
let mut buf = Vecnew;
let reader: =
Boxnew;
let decoded =
block_on
.unwrap;
assert_eq!;
serde Example
use *;
let expect = X ;
let encoded = to_bytes.unwrap;
let decoded: X = from_sync.unwrap;
assert_eq!;
License: Apache-2.0