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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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"
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more