reqwest_lb

Trait LoadBalancer

source
pub trait LoadBalancer {
    type Element;
    type Error;
    type Future: Future<Output = Result<Option<Self::Element>, Self::Error>>;

    // Required method
    fn choose(&self, extensions: &mut Extensions) -> Self::Future;

    // Provided method
    fn boxed(self) -> BoxLoadBalancer<Self::Element, Self::Error>
       where Self: Sized + Send + Sync + 'static,
             Self::Future: Send + 'static { ... }
}

Required Associated Types§

source

type Element

load balancer element type

source

type Error

load balancer choose element maybe error type

source

type Future: Future<Output = Result<Option<Self::Element>, Self::Error>>

load balancer choose element future type

Required Methods§

source

fn choose(&self, extensions: &mut Extensions) -> Self::Future

load balancer choose a effect element

Provided Methods§

source

fn boxed(self) -> BoxLoadBalancer<Self::Element, Self::Error>
where Self: Sized + Send + Sync + 'static, Self::Future: Send + 'static,

Wrap to boxed load balancer

Implementors§