Skip to main content

AsyncTransport

Trait AsyncTransport 

Source
pub trait AsyncTransport {
    type Error;

    // Required method
    fn send<'transport, 'request, 'buffer>(
        &'transport mut self,
        request: TransportRequest<'request>,
        response_body: &'buffer mut [u8],
    ) -> impl Future<Output = Result<TransportResponse<'buffer>, Self::Error>> + Send + 'transport
       where 'request: 'transport,
             'buffer: 'transport;
}
Expand description

Asynchronous transport over caller-owned request and response buffers.

The contract does not select an executor, allocator, HTTP client, TLS implementation, clock, or retry policy. Adapter crates document any runtime requirements they add.

Implementations must treat cancellation as an error path: dropping the returned future must not expose a partially initialized response as a successful TransportResponse. Implementations handling secret response data should also clear temporary owned storage when the future is dropped.

Required Associated Types§

Source

type Error

Transport-specific failure.

Required Methods§

Source

fn send<'transport, 'request, 'buffer>( &'transport mut self, request: TransportRequest<'request>, response_body: &'buffer mut [u8], ) -> impl Future<Output = Result<TransportResponse<'buffer>, Self::Error>> + Send + 'transport
where 'request: 'transport, 'buffer: 'transport,

Sends one request and initializes the complete response body in the caller buffer.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§