Trait HttpStream

Source
pub trait HttpStream: Write {
    type Request: HttpRequest;
    type Response;
    type Error: From<Error> + From<<Self::Request as HttpRequest>::Error>;

    // Required method
    fn finish(self) -> Result<Self::Response, Self::Error>;
}
Expand description

A trait describing an open HTTP stream that can be written to.

Required Associated Types§

Source

type Request: HttpRequest

The request type that opened this stream.

Source

type Response

The response type that will be returned after the request is completed.

Source

type Error: From<Error> + From<<Self::Request as HttpRequest>::Error>

The error type for this stream. Must be compatible with io::Error as well as Self::Request::Error.

Required Methods§

Source

fn finish(self) -> Result<Self::Response, Self::Error>

Finalize and close the stream and return the response object, or any error otherwise.

Implementations on Foreign Types§

Source§

impl HttpStream for Sink

Source§

impl HttpStream for Request<Streaming>

§Feature: hyper

Implementors§