Skip to main content

HttpTransport

Trait HttpTransport 

Source
pub trait HttpTransport:
    Send
    + Sync
    + Unpin
    + 'static {
    // Required method
    fn fetch(
        &self,
        req: Request<Buffer>,
    ) -> impl Future<Output = Result<Response<HttpBody>, Error>> + Send;
}
Expand description

HTTP transport used by OpenDAL services.

Implement this trait to provide a custom HTTP backend. A transport must support 3xx redirection.

Required Methods§

Source

fn fetch( &self, req: Request<Buffer>, ) -> impl Future<Output = Result<Response<HttpBody>, Error>> + Send

Available on non-WebAssembly only.

Fetch a request and return a streamable HttpBody.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl HttpTransport for ReqwestTransport

§

async fn fetch(&self, req: Request<Buffer>) -> Result<Response<HttpBody>, Error>

Available on non-WebAssembly only.

Implementors§