Skip to main content

StorageProxyHandler

Trait StorageProxyHandler 

Source
pub trait StorageProxyHandler<Cx>:
    Send
    + Sync
    + 'static {
    // Required methods
    fn get<'life0, 'async_trait>(
        &'life0 self,
        req: ProxyReq,
        cx: Cx,
    ) -> Pin<Box<dyn Future<Output = ProxyResult<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn head<'life0, 'async_trait>(
        &'life0 self,
        req: ProxyReq,
        cx: Cx,
    ) -> Pin<Box<dyn Future<Output = ProxyResult<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn put<'life0, 'async_trait>(
        &'life0 self,
        req: ProxyReq,
        body: Body,
        cx: Cx,
    ) -> Pin<Box<dyn Future<Output = ProxyResult<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature server only.
Expand description

The HTTP-facing surface produced by the blanket impl below. A host router dispatches to these three methods; each returns a fully-formed axum Response (streaming for GET), or a ProxyError the router turns into a response.

Required Methods§

Source

fn get<'life0, 'async_trait>( &'life0 self, req: ProxyReq, cx: Cx, ) -> Pin<Box<dyn Future<Output = ProxyResult<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Serve a (optionally ranged) body read.

Source

fn head<'life0, 'async_trait>( &'life0 self, req: ProxyReq, cx: Cx, ) -> Pin<Box<dyn Future<Output = ProxyResult<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Serve a metadata-only read.

Source

fn put<'life0, 'async_trait>( &'life0 self, req: ProxyReq, body: Body, cx: Cx, ) -> Pin<Box<dyn Future<Output = ProxyResult<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Serve a whole-object write, consuming the request body.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<B, Cx> StorageProxyHandler<Cx> for B
where B: StorageProxyBackend<Cx>, Cx: Send + 'static,