Msgpack implementation for Rust language.
extern crate msgpack = "msgpack#0.1";
fn main() {
let arr = vec!["str1".to_str(), "str2".to_str()];
let str = msgpack::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
}This code licensed under the same terms as Rust itself: dual MIT/Apache2 license options.
