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