Struct rmp_rpc::Connector [] [src]

pub struct Connector<'a, 'b, S> { /* fields omitted */ }

A Connector is used to initiate a connection with a remote MessagePack-RPC endpoint. Establishing the connection consumes the Connector and gives a Connection.

A Connector should be used only if you need to create a MessagePack-RPC endpoint that behaves both like a client (i.e. sends requests and notifications to the remote endpoint) and like a server (i.e. handles incoming MessagePack-RPC requests and notifications). If you need a regular client that only sends MessagePack-RPC requests and notifications, use ClientOnlyConnector.

Methods

impl<'a, 'b, S: ServiceBuilder + Sync + Send + 'static> Connector<'a, 'b, S>
[src]

[src]

Create a new Connector. address is the address of the remote MessagePack-RPC server.

[src]

Enable TLS for this connection. domain is the hostname of the remote endpoint so which we are connecting.

[src]

Enable TLS for this connection, but without hostname verification. This is dangerous, because it means that any server with a valid certificate will be trusted. Hence, it is not recommended.

[src]

Make the client able to handle incoming requests and notification using the given service. Once the connection is established, the client will act as a server and answer requests and notifications in background, using this service.

[src]

Connect to the remote MessagePack-RPC endpoint. This consumes the Connector.