Struct httpbis::Response [−][src]
pub struct Response(pub Box<Future<Item = (Headers, HttpStreamAfterHeaders), Error = Error> + Send>);
Convenient wrapper around async HTTP response future/stream
Methods
impl Response
[src]
impl Response
pub fn new<F>(future: F) -> Response where
F: Future<Item = (Headers, HttpStreamAfterHeaders), Error = Error> + Send + 'static,
[src]
pub fn new<F>(future: F) -> Response where
F: Future<Item = (Headers, HttpStreamAfterHeaders), Error = Error> + Send + 'static,
pub fn headers_and_stream(
headers: Headers,
stream: HttpStreamAfterHeaders
) -> Response
[src]
pub fn headers_and_stream(
headers: Headers,
stream: HttpStreamAfterHeaders
) -> Response
pub fn headers_and_bytes_stream<S>(headers: Headers, content: S) -> Response where
S: Stream<Item = Bytes, Error = Error> + Send + 'static,
[src]
pub fn headers_and_bytes_stream<S>(headers: Headers, content: S) -> Response where
S: Stream<Item = Bytes, Error = Error> + Send + 'static,
pub fn headers(headers: Headers) -> Response
[src]
pub fn headers(headers: Headers) -> Response
Create a response with only headers
pub fn headers_and_bytes<B: Into<Bytes>>(
header: Headers,
content: B
) -> Response
[src]
pub fn headers_and_bytes<B: Into<Bytes>>(
header: Headers,
content: B
) -> Response
Create a response with headers and response body
pub fn message(message: SimpleHttpMessage) -> Response
[src]
pub fn message(message: SimpleHttpMessage) -> Response
pub fn found_200_plain_text(body: &str) -> Response
[src]
pub fn found_200_plain_text(body: &str) -> Response
pub fn not_found_404() -> Response
[src]
pub fn not_found_404() -> Response
pub fn redirect_302(location: &str) -> Response
[src]
pub fn redirect_302(location: &str) -> Response
pub fn from_stream<S>(stream: S) -> Response where
S: Stream<Item = DataOrHeadersWithFlag, Error = Error> + Send + 'static,
[src]
pub fn from_stream<S>(stream: S) -> Response where
S: Stream<Item = DataOrHeadersWithFlag, Error = Error> + Send + 'static,
pub fn err(err: Error) -> Response
[src]
pub fn err(err: Error) -> Response
pub fn into_stream_flag(
self
) -> Box<Stream<Item = DataOrHeadersWithFlag, Error = Error> + Send>
[src]
pub fn into_stream_flag(
self
) -> Box<Stream<Item = DataOrHeadersWithFlag, Error = Error> + Send>
pub fn into_stream(
self
) -> Box<Stream<Item = DataOrHeaders, Error = Error> + Send>
[src]
pub fn into_stream(
self
) -> Box<Stream<Item = DataOrHeaders, Error = Error> + Send>
pub fn into_part_stream(self) -> DataOrHeadersWithFlagStream
[src]
pub fn into_part_stream(self) -> DataOrHeadersWithFlagStream
pub fn collect(
self
) -> Box<Future<Item = SimpleHttpMessage, Error = Error> + Send>
[src]
pub fn collect(
self
) -> Box<Future<Item = SimpleHttpMessage, Error = Error> + Send>