pub struct RoundRobinRouteProvider { /* private fields */ }Expand description
A simple implementation of the RouteProvider which produces an even distribution of the urls from the input ones.
Implementations§
Source§impl RoundRobinRouteProvider
impl RoundRobinRouteProvider
Sourcepub fn new<T: AsRef<str>>(routes: Vec<T>) -> Result<Self, AgentError>
pub fn new<T: AsRef<str>>(routes: Vec<T>) -> Result<Self, AgentError>
Construct RoundRobinRouteProvider from a vector of urls.
Trait Implementations§
Source§impl Debug for RoundRobinRouteProvider
impl Debug for RoundRobinRouteProvider
Source§impl RouteProvider for RoundRobinRouteProvider
impl RouteProvider for RoundRobinRouteProvider
Source§fn n_ordered_routes(&self, n: usize) -> Result<Vec<Url>, AgentError>
fn n_ordered_routes(&self, n: usize) -> Result<Vec<Url>, AgentError>
Generates up to
n different routing URLs in order of priority. Read moreSource§fn routes_stats(&self) -> RoutesStats
fn routes_stats(&self) -> RoutesStats
Returns statistics about the total number of existing routes and the number of healthy routes.
Auto Trait Implementations§
impl !Freeze for RoundRobinRouteProvider
impl RefUnwindSafe for RoundRobinRouteProvider
impl Send for RoundRobinRouteProvider
impl Sync for RoundRobinRouteProvider
impl Unpin for RoundRobinRouteProvider
impl UnwindSafe for RoundRobinRouteProvider
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