[][src]Trait vapix::Transport

pub trait Transport {
    type Error: Error;
    type Output: Future<Output = Result<Response<Self::Body>, Self::Error>>;
    type Body: Stream<Item = Result<Self::Chunk, Self::Error>>;
    type Chunk: AsRef<[u8]>;
    fn roundtrip(&self, request: Request<Vec<u8>>) -> Self::Output;
}

An HTTP transport.

Associated Types

type Error: Error

The error type returned by this transport.

type Output: Future<Output = Result<Response<Self::Body>, Self::Error>>

The Future representing the part of the roundtrip leading to the response headers.

type Body: Stream<Item = Result<Self::Chunk, Self::Error>>

The Future representing the part of the roundtrip which streams the response body.

type Chunk: AsRef<[u8]>

The type representing a chunk of the response body.

Loading content...

Required methods

fn roundtrip(&self, request: Request<Vec<u8>>) -> Self::Output

Perform an HTTP roundtrip.

Loading content...

Implementors

impl<C, B> Transport for HyperTransport<C, B> where
    C: Connect + Clone + Send + Sync + 'static,
    B: HttpBody + Send + 'static + From<Vec<u8>>,
    B::Data: Send,
    B::Error: Into<Box<dyn Error + Send + Sync>>, 
[src]

type Error = Error

type Output = ResponseFuture

type Body = Body

type Chunk = Bytes

Loading content...