ruststream 0.7.0-rc.2

Async messaging framework for Rust: broker-agnostic traits, router, codecs, and a conformance harness for broker authors.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ruststream::{BytesMut, Deserialized, Serialized};

// Both derives read the one attribute, so a type that declares only its writer cannot also be a
// self-deserializing input: the missing half is named where it is missing.
#[derive(Serialized, Deserialized)]
#[wire(encode = write_order)]
struct Order {
    id: u64,
}

fn write_order(order: &Order, buf: &mut BytesMut) {
    buf.extend_from_slice(&order.id.to_be_bytes());
}

fn main() {}