| Crates.io | messagepack-core |
| lib.rs | messagepack-core |
| version | 0.1.7 |
| created_at | 2025-03-11 09:11:11.351838+00 |
| updated_at | 2025-09-21 14:02:59.329984+00 |
| description | messagepack for `no_std` |
| homepage | |
| repository | https://github.com/tunamaguro/messagepack-rs |
| max_upload_size | |
| id | 1587733 |
| size | 152,691 |
messagepack for no_std
use messagepack_core::{Decode, Encode, io::{SliceWriter, SliceReader}};
let mut buf = [0u8; 12];
let mut writer = SliceWriter::from_slice(&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);
Licensed under either of
at your option.
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.