1use std::{net::SocketAddr, time::Duration};
2
3#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct RpcClientConfig {
6 pub endpoint: String,
8 pub connect_timeout: Duration,
10 pub request_timeout: Duration,
12}
13
14impl RpcClientConfig {
15 pub fn new(endpoint: impl Into<String>) -> Self {
17 Self {
18 endpoint: endpoint.into(),
19 connect_timeout: Duration::from_secs(3),
20 request_timeout: Duration::from_secs(5),
21 }
22 }
23}
24
25#[derive(Debug, Clone, PartialEq, Eq)]
27pub struct RpcServerConfig {
28 pub name: String,
30 pub addr: SocketAddr,
32}
33
34impl RpcServerConfig {
35 pub fn new(name: impl Into<String>, addr: SocketAddr) -> Self {
37 Self {
38 name: name.into(),
39 addr,
40 }
41 }
42}