Skip to main content

LoadBalancerTrait

Trait LoadBalancerTrait 

Source
pub trait LoadBalancerTrait {
    type Element;
    type Error;

    // Required method
    fn choose<'life0, 'life1, 'async_trait>(
        &'life0 self,
        extensions: &'life1 mut Extensions,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Element>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

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

Required Associated Types§

Source

type Element

load balancer element type

Source

type Error

load balancer choose element maybe error type

Required Methods§

Source

fn choose<'life0, 'life1, 'async_trait>( &'life0 self, extensions: &'life1 mut Extensions, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Element>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

load balancer choose a effect element

Provided Methods§

Source

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

Wrap to boxed load balancer

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§