Trait apisdk::UrlRewriter

source ·
pub trait UrlRewriter: 'static + Send + Sync {
    // Required method
    fn rewrite<'life0, 'async_trait>(
        &'life0 self,
        url: Url
    ) -> Pin<Box<dyn Future<Output = Result<Url, ApiError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

This trait is used to rewrite base_url

Required Methods§

source

fn rewrite<'life0, 'async_trait>( &'life0 self, url: Url ) -> Pin<Box<dyn Future<Output = Result<Url, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rewrite url if possible

Trait Implementations§

source§

impl UrlRewriter for Box<dyn UrlRewriter>

source§

fn rewrite<'life0, 'async_trait>( &'life0 self, url: Url ) -> Pin<Box<dyn Future<Output = Result<Url, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rewrite url if possible

Implementations on Foreign Types§

source§

impl UrlRewriter for IpAddr

source§

fn rewrite<'life0, 'async_trait>( &'life0 self, url: Url ) -> Pin<Box<dyn Future<Output = Result<Url, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl UrlRewriter for SocketAddr

source§

fn rewrite<'life0, 'async_trait>( &'life0 self, url: Url ) -> Pin<Box<dyn Future<Output = Result<Url, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl UrlRewriter for Box<dyn UrlRewriter>

source§

fn rewrite<'life0, 'async_trait>( &'life0 self, url: Url ) -> Pin<Box<dyn Future<Output = Result<Url, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<F> UrlRewriter for F
where F: Fn(Url) -> Result<Url, ApiError> + 'static + Send + Sync,