Skip to content

Geal/rust-msgpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-msgpack Build Status

Msgpack implementation for Rust language.

Quickstart

extern mod msgpack = "msgpack#0.1";

fn main() {
  let arr = ~[~"str1", ~"str2"];
  let str = msgpack::to_msgpack(&arr);
  println!("Encoded: {:?}", str);

  let dec: ~[~str] = msgpack::from_msgpack(str);
  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 mod serialize;

#[deriving(Encodable,Decodable)]
struct MyStruct {
  a: ~[u32],
  s: ~str
}

License

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

About

msgpack.org implementation for Rust language / msgpack.org[Rust]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%