Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mneumann/rust-msgpack
[DEPRECATED] msgpack.org implementation for Rust language. Please use https://github.com/3Hren/msgpack-rust
https://github.com/mneumann/rust-msgpack
Last synced: 2 months ago
JSON representation
[DEPRECATED] msgpack.org implementation for Rust language. Please use https://github.com/3Hren/msgpack-rust
- Host: GitHub
- URL: https://github.com/mneumann/rust-msgpack
- Owner: mneumann
- Archived: true
- Created: 2012-12-19T00:16:02.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2020-08-18T10:10:04.000Z (over 4 years ago)
- Last Synced: 2024-10-06T11:34:52.570Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 168 KB
- Stars: 121
- Watchers: 10
- Forks: 31
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-rust - mneumann/rust-msgpack - ci.org/mneumann/rust-msgpack.svg?branch=master">](https://travis-ci.org/mneumann/rust-msgpack) (代码 / 编码)
README
> :warning: **WARNING: This is no longer maintained nor works with current versions of Rust!
Please use https://github.com/3Hren/msgpack-rust instead.**# rust-msgpack [![Build Status][travis-image]][travis-link]
[travis-image]: https://travis-ci.org/mneumann/rust-msgpack.png?branch=master
[travis-link]: https://travis-ci.org/mneumann/rust-msgpack[Msgpack][msgpack-home] implementation for [Rust][rust-home] language.
[msgpack-home]: http://www.msgpack.org
[rust-home]: http://www.rust-lang.org## Installation
Simply include the rust-msgpack in your Cargo dependencies.
```toml
[dependencies.msgpack]git = "[email protected]:mneumann/rust-msgpack.git"
```## Quickstart
```rust
extern crate msgpack;fn main() {
let arr = vec!["str1".to_string(), "str2".to_string()];
let str = msgpack::Encoder::to_msgpack(&arr).ok().unwrap();
println!("Encoded: {}", str);let dec: Vec = msgpack::from_msgpack(str).ok().unwrap();
println!("Decoded: {}", dec);
}
```To enable your own data structures to be automatically serialized from and to
msgpack, derive fromEncodable
andDecodable
as shown
in the following example:```rust
extern crate serialize;#[deriving(Encodable,Decodable)]
struct MyStruct {
a: Vec,
s: String
}
```## Testing
```
cargo test
```## License
This code licensed under the same terms as Rust itself: dual MIT/Apache2 license options.