{"id":24231503,"url":"https://github.com/codx-dev/msgpacker","last_synced_at":"2025-09-22T23:31:57.317Z","repository":{"id":46346947,"uuid":"420277858","full_name":"codx-dev/msgpacker","owner":"codx-dev","description":"MessagePack serializer implementation for Rust / msgpack.org[Rust]","archived":false,"fork":false,"pushed_at":"2024-10-14T10:26:34.000Z","size":3860,"stargazers_count":14,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-14T05:30:49.237Z","etag":null,"topics":["messagepack","msgpack","rust"],"latest_commit_sha":null,"homepage":"https://msgpack.org/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codx-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-23T00:37:00.000Z","updated_at":"2024-10-20T10:18:20.000Z","dependencies_parsed_at":"2022-09-26T17:51:13.201Z","dependency_job_id":null,"html_url":"https://github.com/codx-dev/msgpacker","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codx-dev%2Fmsgpacker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codx-dev%2Fmsgpacker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codx-dev%2Fmsgpacker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codx-dev%2Fmsgpacker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codx-dev","download_url":"https://codeload.github.com/codx-dev/msgpacker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233891636,"owners_count":18746477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["messagepack","msgpack","rust"],"created_at":"2025-01-14T14:19:26.139Z","updated_at":"2025-09-22T23:31:52.020Z","avatar_url":"https://github.com/codx-dev.png","language":"Rust","readme":"# MessagePacker - a no-std msgpack implementation\n\n[![crates.io](https://img.shields.io/crates/v/msgpacker?label=latest)](https://crates.io/crates/msgpacker)\n[![Documentation](https://docs.rs/msgpacker/badge.svg)](https://docs.rs/msgpacker/)\n[![License](https://img.shields.io/crates/l/msgpacker.svg)]()\n\nThe protocol specification can be found [here](https://github.com/msgpack/msgpack/blob/master/spec.md).\n\nThis crate targets simplicity and performance. No dependencies are used, just the standard Rust library.\n\nIt will implement `Packable` and `Unpackable` for Rust atomic types. The traits can also be implemented manually.\n\n## Features\n\n- alloc: Implements the functionality for `Vec`, `String`, and unlocks custom extensions.\n- derive: Enables `MsgPacker` derive convenience macro.\n- strict: Will panic if there is a protocol violation of the size of a buffer; the maximum allowed size is `u32::MAX`.\n- std: Will implement the `Packable` and `Unpackable` for `std` collections.\n\n## Example\n\n```rust\nuse msgpacker::prelude::*;\nuse std::collections::HashMap;\n\n// boilerplate derives - those aren't required\n#[derive(Debug, PartialEq, Eq)]\n// this convenience derive macro will implement `Packable` and `Unpackable`\n#[derive(MsgPacker)]\npub struct City {\n    name: String,\n\n    // The traits are implemented for stdlib collections. If you have a custom map, you can use the\n    // directive `#[msgpacker(map)]` so the traits will be automatically implemented through the\n    // iterators of the map.\n    inhabitants_per_street: HashMap\u003cString, u64\u003e,\n\n    // This is also automatically implemented. The manual implementation is via `#[msgpacker(array)]`.\n    zones: Vec\u003cString\u003e,\n}\n\n// create an instance of a city.\nlet city = City {\n    name: \"Kuala Lumpur\".to_string(),\n    inhabitants_per_street: HashMap::from([\n        (\"Street 1\".to_string(), 10),\n        (\"Street 2\".to_string(), 20),\n    ]),\n    zones: vec![\"Zone 1\".to_string(), \"Zone 2\".to_string()],\n};\n\n// serialize the city into bytes\nlet mut buf = Vec::new();\nlet n = city.pack(\u0026mut buf);\nprintln!(\"serialized {} bytes\", n);\n\n// deserialize the city and assert correctness\nlet (n, deserialized) = City::unpack(\u0026buf).unwrap();\nprintln!(\"deserialized {} bytes\", n);\nassert_eq!(city, deserialized);\n```\n\n## Benchmarks\n\nResults obtained with `Intel(R) Core(TM) i9-9900X CPU @ 3.50GHz`.\n\nThe simplicity of the implementation unlocks a performance more than ~10x better than [rmp-serde](https://crates.io/crates/rmp-serde).\n\n\n#### Pack 1.000 elements\n\n![image](https://github.com/codx-dev/msgpacker/assets/8730839/ef69622d-0e2f-4bb1-b47c-6412d89fc19a)\n![image](https://github.com/codx-dev/msgpacker/assets/8730839/ce2de037-252a-4c90-b429-430d131ccf7e)\n\n#### Unpack 1.000 elements\n\n![image](https://github.com/codx-dev/msgpacker/assets/8730839/5576f99d-6f37-4907-89db-5d666b13f9d5)\n![image](https://github.com/codx-dev/msgpacker/assets/8730839/234c31d2-f319-414b-9418-4103e97d0a9c)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodx-dev%2Fmsgpacker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodx-dev%2Fmsgpacker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodx-dev%2Fmsgpacker/lists"}