Struct svc_agent::SharedGroup
source · pub struct SharedGroup { /* private fields */ }
Expand description
A group of agents which shares a subscription. Commonly used for balancing requests over a group of instances of some service.
Implementations§
sourcepub fn new(label: &str, account_id: AccountId) -> Self
pub fn new(label: &str, account_id: AccountId) -> Self
Builds a SharedGroup.
Arguments
label
– shared group label to distinct it from the others if there are any.account_id
– service account id. All the group’s participant agents must have the same.
Example
let_account_id = AccountId::new("service_name", "svc.example.org");
let shared_group = SharedGroup::new("loadbalancer", account_id);
Trait Implementations§
source§fn clone(&self) -> SharedGroup
fn clone(&self) -> SharedGroup
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats SharedGroup as LABEL.ACCOUNT_ID
.
Example
let_account_id = AccountId::new("service_name", "svc.example.org");
let shared_group = SharedGroup::new("loadbalancer", account_id);
format!("{}", shared_group); // => "loadbalancer.service_name.svc.example.org"
source§fn eq(&self, other: &SharedGroup) -> bool
fn eq(&self, other: &SharedGroup) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.