Struct msgpack_rpc::Endpoint [] [src]

pub struct Endpoint { /* fields omitted */ }

An endpoint represents a peer of MessagePack-RPC.

Methods

impl Endpoint
[src]

[src]

Create a RPC endpoint from asyncrhonous I/O.

[src]

Return the reference of Client associated with the endpoint.

[src]

Return the instance of Client associated with the endpoint.

This function is useful if the endpoint doesn't handle any incoming requests/notifications. If the endpoint requires to serve requests/notifications, use Endpoint::serve() instead.

[src]

Start to serve incoming requests.

This function does not block current thread, but returns an instance of Client associated with the I/O. If you want to run the event loop infinitely, use futures::future::empty() as follows:

let mut core = Core::new().unwrap();
endpoint.serve(&core.handle(), foo);
let _: Result<(), ()> = core.run(empty());