tropocol 0.1.1

Send and receive serde-compatible objects over TCP (async)
Documentation

Send and receive serde-compatible objects over TCP (async)

Example

let addr = ("127.0.0.1", 9000);
let stream = std::net::TcpStream::connect(addr).unwrap();
let stream = async_net::TcpStream::try_from(stream).unwrap();

type Incoming = String;
type Outgoing = u32;

let (task, tx, mut rx) = tropocol::async_fifo::session::<Outgoing, Incoming>(stream);
// spawn this task in an asynchronous executor

tx.send(0u32 as Outgoing);

async {
    let s: Incoming = rx.recv().await.unwrap();
};