Struct station::rpc::RpcClient [−][src]
pub struct RpcClient<T, U> { /* fields omitted */ }
Expand description
The RPC client sends data of type T
to a server and expects a response of type U
.
It is extremely important that the types on the client and server match, else the RPC calls will likely fail.
Implementations
impl<T, U> RpcClient<T, U> where
T: DeserializeOwned + Serialize + 'static,
U: DeserializeOwned + Serialize + 'static,
impl<T, U> RpcClient<T, U> where
T: DeserializeOwned + Serialize + 'static,
U: DeserializeOwned + Serialize + 'static,
Create an RPC client pointing to a TCP socket address.
Create an RPC client pointing to a Unix stream socket address.
Call the RPC and return the response.
If the types used to initialize the RPC client differ from the RPC server, some very
cryptic errors can occur. Since bincode
is used for serialization, the type of error can
differ depending on where the deserialization occurs. In any case, it’s important to make
sure types are matched properly when creating RPC servers and clients.
Wait indefinitely for the RPC server to come online.