pub struct RoundRobin<T>{ /* private fields */ }Expand description
A round-robin load balancer that selects entries in sequential order.
Implementations§
Source§impl<T> RoundRobin<T>
impl<T> RoundRobin<T>
Sourcepub async fn update<F, R, N>(&self, handler: F) -> Result<N>
pub async fn update<F, R, N>(&self, handler: F) -> Result<N>
Update the inner state using an async callback.
Sourcepub async fn update_timer<F, R>(
&self,
handler: F,
interval: Duration,
) -> Result<JoinHandle<()>>
pub async fn update_timer<F, R>( &self, handler: F, interval: Duration, ) -> Result<JoinHandle<()>>
Spawn a background task that calls handler every interval.
The handler is called once immediately; if that initial call fails the error is returned and no background task is spawned.
Trait Implementations§
Source§impl<T> Clone for RoundRobin<T>
impl<T> Clone for RoundRobin<T>
Source§fn clone(&self) -> RoundRobin<T>
fn clone(&self) -> RoundRobin<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> !RefUnwindSafe for RoundRobin<T>
impl<T> !UnwindSafe for RoundRobin<T>
impl<T> Freeze for RoundRobin<T>
impl<T> Send for RoundRobin<T>
impl<T> Sync for RoundRobin<T>
impl<T> Unpin for RoundRobin<T>
impl<T> UnsafeUnpin for RoundRobin<T>
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