Skip to main content

Transport

Trait Transport 

Source
pub trait Transport: Sync {
    // Required method
    fn send(
        &self,
        request: ApiRequest,
    ) -> impl Future<Output = Result<ApiResponse, ClientError>> + Send;

    // Provided method
    fn open(
        &self,
        path: String,
    ) -> impl Future<Output = Result<Chunks, ClientError>> + Send { ... }
}
Expand description

Sends requests to the API.

Required Methods§

Source

fn send( &self, request: ApiRequest, ) -> impl Future<Output = Result<ApiResponse, ClientError>> + Send

Sends one request.

Provided Methods§

Source

fn open( &self, path: String, ) -> impl Future<Output = Result<Chunks, ClientError>> + Send

Opens GET <path> and reads its body as it comes (server-sent events); a transport that can’t stream says so.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§