Struct station::rpc::RpcServer [−][src]
pub struct RpcServer { /* fields omitted */ }
Expand description
The RPC server listens for incoming messages of type T
, processes them, and returns a result
containing bytes that can be deserialized to the type U
.
Implementations
pub fn with_tcp_port<T, U>(
name: &'static str,
port: u16,
callback: Callback<T, U>
) -> RpcServer where
T: Debug + DeserializeOwned + Serialize + 'static,
U: Debug + DeserializeOwned + Serialize + 'static,
pub fn with_tcp_port<T, U>(
name: &'static str,
port: u16,
callback: Callback<T, U>
) -> RpcServer where
T: Debug + DeserializeOwned + Serialize + 'static,
U: Debug + DeserializeOwned + Serialize + 'static,
Create an RPC server bound to a TCP port.
Args:
name
: A name to refer to the RPC server.port
: The TCP port to bind the server to.callback
: The function to call on incoming data.
pub fn with_unix_socket<T, U>(
name: &'static str,
path: &Path,
callback: Callback<T, U>
) -> RpcServer where
T: Debug + DeserializeOwned + Serialize + 'static,
U: Debug + DeserializeOwned + Serialize + 'static,
pub fn with_unix_socket<T, U>(
name: &'static str,
path: &Path,
callback: Callback<T, U>
) -> RpcServer where
T: Debug + DeserializeOwned + Serialize + 'static,
U: Debug + DeserializeOwned + Serialize + 'static,
Create an RPC server bound to a Unix stream socket.
Args:
name
: A name to refer to the RPC server.path
: The unix socket path to bind the server to.callback
: The function to call on incoming data.
Check if the RPC server is running.