pub trait Upstreams: Send + Sync + 'static {
    type Error: StdError + Send + Sync + 'static;

    // Required method
    fn elect<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<&str, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Upstreams trait.

Required Associated Types§

source

type Error: StdError + Send + Sync + 'static

Error type.

Required Methods§

source

fn elect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&str, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Elect a upstream to process current request.

Implementations on Foreign Types§

source§

impl Upstreams for &'static str

§

type Error = Infallible

source§

fn elect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&str, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl Upstreams for String

§

type Error = Infallible

source§

fn elect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&str, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<T> Upstreams for Vec<T>
where T: AsRef<str> + Send + Sync + 'static,

§

type Error = Error

source§

fn elect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&str, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<const N: usize> Upstreams for [&'static str; N]

§

type Error = Error

source§

fn elect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&str, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§