#[non_exhaustive]pub struct Peer {
pub ip: String,
pub port: i64,
pub labels: HashMap<String, String>,
pub principal: String,
pub region_code: String,
}Expand description
This message defines attributes for a node that handles a network request.
The node can be either a service or an application that sends, forwards,
or receives the request. Service peers should fill in
principal and labels as appropriate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ip: StringThe IP address of the peer.
port: i64The network port of the peer.
labels: HashMap<String, String>The labels associated with the peer.
principal: StringThe identity of this peer. Similar to Request.auth.principal, but
relative to the peer instead of the request. For example, the
identity associated with a load balancer that forwarded the request.
region_code: StringThe CLDR country/region code associated with the above IP address.
If the IP address is private, the region_code should reflect the
physical location where this peer is running.
Implementations§
Source§impl Peer
impl Peer
pub fn new() -> Self
Sourcepub fn set_principal<T: Into<String>>(self, v: T) -> Self
pub fn set_principal<T: Into<String>>(self, v: T) -> Self
Sets the value of principal.
Sourcepub fn set_region_code<T: Into<String>>(self, v: T) -> Self
pub fn set_region_code<T: Into<String>>(self, v: T) -> Self
Sets the value of region_code.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.