Skip to main content

UpstreamClient

Trait UpstreamClient 

Source
pub trait UpstreamClient: Send + Sync {
    // Required method
    fn send<'life0, 'async_trait>(
        &'life0 self,
        req: Request<Bytes>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn send_websocket<'life0, 'async_trait>(
        &'life0 self,
        _req: Request<Bytes>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn send_streaming<'life0, 'async_trait>(
        &'life0 self,
        req: Request<Bytes>,
    ) -> Pin<Box<dyn Future<Output = Result<(StatusCode, HeaderMap, RespStream), ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn open_websocket<'life0, 'async_trait>(
        &'life0 self,
        _req: Request<Bytes>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ConduitSocket>, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Host-owned upstream capability. Implementations apply the resolved proxy, TLS profile, capture policy, and platform transport; channels only construct requests and interpret responses.

Required Methods§

Source

fn send<'life0, 'async_trait>( &'life0 self, req: Request<Bytes>, ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn send_websocket<'life0, 'async_trait>( &'life0 self, _req: Request<Bytes>, ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn send_streaming<'life0, 'async_trait>( &'life0 self, req: Request<Bytes>, ) -> Pin<Box<dyn Future<Output = Result<(StatusCode, HeaderMap, RespStream), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn open_websocket<'life0, 'async_trait>( &'life0 self, _req: Request<Bytes>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ConduitSocket>, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§