#messagepack #rpc #write #value #reader

mpack

An alternative MessagePack implementation for Rust

9 releases

Uses old Rust 2015

0.1.2 Jul 8, 2016
0.1.1 Jul 1, 2016
0.0.6 Jun 28, 2016
0.0.5 Mar 9, 2015
0.0.4 Jan 30, 2015

#25 in #msgpack


Used in neovim

MIT license

44KB
908 lines

mpack Build Status

A new MessagePack implementation for Rust.


lib.rs:

A MessagePack implementation for Rust.

use std::net::TcpStream;
use mpack::{Value, write_value};

let mut conn = TcpStream::connect("127.0.0.1:8081").unwrap();

// write values
write(&mut conn, 3 as i32).unwrap();

Reading values is just as easy:

use std::net::TcpStream;
use mpack::{Value, Reader};

let mut conn = TcpStream::connect("127.0.0.1:8081").unwrap();
let mut reader = Reader::new(conn);

let value = reader.read_value().unwrap();
// `value` can be inspected with `match` or converted directly with a convenience method

No runtime deps