ruststream 0.7.3

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
16
17
18
//! A `Serialize` value published in a build with no codec feature: nothing in the chain names a
//! codec, and the encoded wire needs one.
use ruststream::memory::MemoryBroker;
use ruststream::runtime::PublishExt;
use ruststream::{Broker, Outgoing};

#[derive(Outgoing, serde::Serialize)]
#[outgoing(name = "orders.done")]
struct OrderDone {
    id: u64,
}

fn main() {
    let publisher = MemoryBroker::new().publisher();
    let _ = async {
        publisher.message(&OrderDone { id: 7 }).publish().await
    };
}