Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

mneumann/rust-msgpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ 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

Msgpack implementation for Rust language.

Installation

Simply include the rust-msgpack in your Cargo dependencies.

[dependencies.msgpack]

git = "[email protected]:mneumann/rust-msgpack.git"

Quickstart

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<String> = msgpack::from_msgpack(str).ok().unwrap();
  println!("Decoded: {}", dec);
}

To enable your own data structures to be automatically serialized from and to msgpack, derive from Encodable and Decodable as shown in the following example:

extern crate serialize;

#[deriving(Encodable,Decodable)]
struct MyStruct {
  a: Vec<u32>,
  s: String
}

Testing

cargo test

License

This code licensed under the same terms as Rust itself: dual MIT/Apache2 license options.

About

[DEPRECATED] msgpack.org implementation for Rust language. Please use https://github.com/3Hren/msgpack-rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages