Skip to main content

rs_zero/core/
service.rs

1use std::net::SocketAddr;
2
3/// Common service identity used by REST and RPC runtimes.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct ServiceInfo {
6    /// Logical service name.
7    pub name: String,
8    /// Bound address.
9    pub addr: SocketAddr,
10}
11
12impl ServiceInfo {
13    /// Creates a service identity.
14    pub fn new(name: impl Into<String>, addr: SocketAddr) -> Self {
15        Self {
16            name: name.into(),
17            addr,
18        }
19    }
20}