pub struct LoadBalancer { /* private fields */ }Expand description
Load balancer
Implementations§
Source§impl LoadBalancer
impl LoadBalancer
pub fn new() -> Self
Sourcepub fn balancing_strategy(&self) -> &BalancingStrategy
pub fn balancing_strategy(&self) -> &BalancingStrategy
Returns the current balancing strategy.
Sourcepub fn set_balancing_strategy(&mut self, strategy: BalancingStrategy)
pub fn set_balancing_strategy(&mut self, strategy: BalancingStrategy)
Set the balancing strategy.
Sourcepub fn set_unit_metrics(&mut self, unit_id: &str, metrics: UnitMetrics)
pub fn set_unit_metrics(&mut self, unit_id: &str, metrics: UnitMetrics)
Record or update metrics for a computation unit.
Sourcepub fn get_unit_metrics(&self, unit_id: &str) -> Option<&UnitMetrics>
pub fn get_unit_metrics(&self, unit_id: &str) -> Option<&UnitMetrics>
Look up metrics for a computation unit.
Sourcepub fn remove_unit_metrics(&mut self, unit_id: &str) -> Option<UnitMetrics>
pub fn remove_unit_metrics(&mut self, unit_id: &str) -> Option<UnitMetrics>
Remove metrics for a computation unit.
Sourcepub fn tracked_unit_count(&self) -> usize
pub fn tracked_unit_count(&self) -> usize
Returns the number of units with recorded metrics.
Auto Trait Implementations§
impl Freeze for LoadBalancer
impl RefUnwindSafe for LoadBalancer
impl Send for LoadBalancer
impl Sync for LoadBalancer
impl Unpin for LoadBalancer
impl UnsafeUnpin for LoadBalancer
impl UnwindSafe for LoadBalancer
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more