Trait rama::proxy::ProxyDB

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

    // Required method
    fn get_proxy_if(
        &self,
        ctx: TransportContext,
        filter: ProxyFilter,
        predicate: impl ProxyQueryPredicate,
    ) -> impl Future<Output = Result<Proxy, Self::Error>> + Send;

    // Provided method
    fn get_proxy(
        &self,
        ctx: TransportContext,
        filter: ProxyFilter,
    ) -> impl Future<Output = Result<Proxy, Self::Error>> + Send { ... }
}
Expand description

The trait to implement to provide a proxy database to other facilities, such as connection pools, to provide a proxy based on the given TransportContext and ProxyFilter.

Required Associated Types§

type Error: Send + Sync + 'static

The error type that can be returned by the proxy database

Examples are generic I/O issues or even more common if no proxy match could be found.

Required Methods§

fn get_proxy_if( &self, ctx: TransportContext, filter: ProxyFilter, predicate: impl ProxyQueryPredicate, ) -> impl Future<Output = Result<Proxy, Self::Error>> + Send

Same as Self::get_proxy but with a predicate to filter out found proxies that do not match the given predicate.

Provided Methods§

fn get_proxy( &self, ctx: TransportContext, filter: ProxyFilter, ) -> impl Future<Output = Result<Proxy, Self::Error>> + Send

Get a Proxy based on the given TransportContext and ProxyFilter, or return an error in case no Proxy could be returned.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl ProxyDB for ()

§

type Error = OpaqueError

§

async fn get_proxy_if( &self, _ctx: TransportContext, _filter: ProxyFilter, _predicate: impl ProxyQueryPredicate, ) -> Result<Proxy, <() as ProxyDB>::Error>

§

async fn get_proxy( &self, _ctx: TransportContext, _filter: ProxyFilter, ) -> Result<Proxy, <() as ProxyDB>::Error>

§

impl<T> ProxyDB for Option<T>
where T: ProxyDB, <T as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = OpaqueError

§

async fn get_proxy_if( &self, ctx: TransportContext, filter: ProxyFilter, predicate: impl ProxyQueryPredicate, ) -> Result<Proxy, <Option<T> as ProxyDB>::Error>

§

async fn get_proxy( &self, ctx: TransportContext, filter: ProxyFilter, ) -> Result<Proxy, <Option<T> as ProxyDB>::Error>

§

impl<T> ProxyDB for Arc<T>
where T: ProxyDB,

§

type Error = <T as ProxyDB>::Error

§

fn get_proxy_if( &self, ctx: TransportContext, filter: ProxyFilter, predicate: impl ProxyQueryPredicate, ) -> impl Future<Output = Result<Proxy, <Arc<T> as ProxyDB>::Error>> + Send

§

fn get_proxy( &self, ctx: TransportContext, filter: ProxyFilter, ) -> impl Future<Output = Result<Proxy, <Arc<T> as ProxyDB>::Error>> + Send

Implementors§

§

impl ProxyDB for MemoryProxyDB

§

impl ProxyDB for Proxy

§

impl<A, B> ProxyDB for Either<A, B>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C> ProxyDB for Either3<A, B, C>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D> ProxyDB for Either4<A, B, C, D>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, D: ProxyDB, <D as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E> ProxyDB for Either5<A, B, C, D, E>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, D: ProxyDB, <D as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, E: ProxyDB, <E as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F> ProxyDB for Either6<A, B, C, D, E, F>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, D: ProxyDB, <D as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, E: ProxyDB, <E as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, F: ProxyDB, <F as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G> ProxyDB for Either7<A, B, C, D, E, F, G>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, D: ProxyDB, <D as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, E: ProxyDB, <E as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, F: ProxyDB, <F as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, G: ProxyDB, <G as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G, H> ProxyDB for Either8<A, B, C, D, E, F, G, H>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, D: ProxyDB, <D as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, E: ProxyDB, <E as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, F: ProxyDB, <F as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, G: ProxyDB, <G as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, H: ProxyDB, <H as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<A, B, C, D, E, F, G, H, I> ProxyDB for Either9<A, B, C, D, E, F, G, H, I>
where A: ProxyDB, <A as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, B: ProxyDB, <B as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, C: ProxyDB, <C as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, D: ProxyDB, <D as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, E: ProxyDB, <E as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, F: ProxyDB, <F as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, G: ProxyDB, <G as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, H: ProxyDB, <H as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>, I: ProxyDB, <I as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>

§

impl<T> ProxyDB for LiveUpdateProxyDB<T>
where T: ProxyDB, <T as ProxyDB>::Error: Into<Box<dyn Error + Sync + Send>>,

§

type Error = Box<dyn Error + Sync + Send>