[][src]Trait fastly::response::ResponseExt

pub trait ResponseExt: Sized {
    fn inner_to_body(self) -> Result<Response<Body>, Error>;
fn inner_to_bytes(self) -> Result<Response<Vec<u8>>, Error>; fn send_downstream(self) -> Result<(), Error> { ... }
fn send_downstream_streaming(self) -> Result<StreamingBody, Error> { ... } }

Required methods

fn inner_to_body(self) -> Result<Response<Body>, Error>

Replace the body of a response with a Body with the same contents.

fn inner_to_bytes(self) -> Result<Response<Vec<u8>>, Error>

Replace the body of a response with the remaining contents of its body.

Note that this will involve copying and buffering the body, and so should only be used for convenience on small response bodies.

Loading content...

Provided methods

Loading content...

Implementors

impl ResponseExt for Response<()>[src]

impl ResponseExt for Response<Body>[src]

fn send_downstream(self) -> Result<(), Error>[src]

Send this response downstream to the client.

This will only begin sending bytes once the program has completed execution. If you want to begin sending before the program is complete, use ResponseExt::send_downstream_streaming().

fn send_downstream_streaming(self) -> Result<StreamingBody, Error>[src]

Immediately begin sending this response downstream to the client, and return a StreamingBody that can accept further data to send.

impl ResponseExt for Response<String>[src]

impl ResponseExt for Response<Vec<u8>>[src]

impl<'_> ResponseExt for Response<&'_ str>[src]

impl<'_> ResponseExt for Response<&'_ [u8]>[src]

Loading content...