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_std
serde support -
std::io::{Read, Write}
support instd
mode - Async IO support via
futures-io
ortokio
features - 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 theserde
crateserde_std
- a workaround for enablingstd
features in the serde lib, (largely the std::io::Error trait) - will become a stub feature when weak dependency features landfutures-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 = Vec new;
let reader: = Box new;
let decoded = from_sync.unwrap;
assert_eq!;
Async Example
use *;
let expect = Map;
let mut buf = Vec new;
let reader: =
Box new;
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