12 releases
Uses new Rust 2024
| 0.2.4 | Apr 12, 2026 |
|---|---|
| 0.2.3 | Apr 11, 2026 |
| 0.2.2 | Feb 26, 2026 |
| 0.2.0 | Oct 1, 2025 |
| 0.1.2 | Mar 11, 2025 |
#2433 in Encoding
Used in messagepack-serde
165KB
4.5K
SLoC
messagepack-core
messagepack for no_std
Example
use messagepack_core::{Decode, Encode, io::{SliceWriter, SliceReader}};
let mut buf = [0u8; 12];
let mut writer = SliceWriter::new(&mut buf);
let written = "MessagePack".encode(&mut writer).unwrap();
assert_eq!(
buf,
[
0xab, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x61, 0x63, 0x6b
]
);
assert_eq!(written, 12);
let mut reader = SliceReader::new(&buf);
let decoded = <&str as Decode>::decode(&mut reader).unwrap();
assert_eq!(decoded, "MessagePack");
assert_eq!(reader.rest().len(), 0);
Installation
Add this crate to Cargo.toml. If you want use this crate in no_std, disable default feature.
messagepack-core = { version = "0.2", default-features = false }
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~200KB