Crate tokio_jsonrpc [] [src]

A JSON RPC protocol for the tokio framework.

This implements the handling of the JSON RPC 2.0 specification. Currently, only the low-level parts are implemented, more will come in future versions.

Examples

let connections = listener.incoming();
let service = connections.for_each(|(stream, _)| {
    let messages = stream.framed(LineCodec::new());
    let (write, read) = messages.split();
    let answers = read.filter_map(|message| {
        match message {
            _ => unimplemented!(),
        }
    });
    handle.spawn(write.send_all(answers).map(|_| ()).map_err(|_| ()));
    Ok(())
});

Reexports

pub use message::Message;
pub use message::Parsed;
pub use codec::Boundary as BoundaryCodec;
pub use codec::Line as LineCodec;

Modules

codec

The codecs to encode and decode messages from a stream of bytes.

message

A JSON-RPC 2.0 messages