LoadBalancerTrait

Trait LoadBalancerTrait 

Source
pub trait LoadBalancerTrait {
    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§