Trait salvo_proxy::Upstreams

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

    // Required method
    fn elect(&self) -> impl Future<Output = Result<&str, Self::Error>> + Send;
}
Expand description

Upstreams trait.

Required Associated Types§

source

type Error: StdError + Send + Sync + 'static

Error type.

Required Methods§

source

fn elect(&self) -> impl Future<Output = Result<&str, Self::Error>> + Send

Elect a upstream to process current request.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Upstreams for &'static str

§

type Error = Infallible

source§

async fn elect(&self) -> Result<&str, Self::Error>

source§

impl Upstreams for String

§

type Error = Infallible

source§

async fn elect(&self) -> Result<&str, Self::Error>

source§

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

§

type Error = Error

source§

async fn elect(&self) -> Result<&str, Self::Error>

source§

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

§

type Error = Error

source§

async fn elect(&self) -> Result<&str, Self::Error>

Implementors§