Struct rouille::ResponseBody
[−]
[src]
pub struct ResponseBody { // some fields omitted }
An opaque type that represents the body of a response.
Methods
impl ResponseBody
[src]
fn empty() -> ResponseBody
Builds a ResponseBody
that doesn't return any data.
fn from_reader<R>(data: R) -> ResponseBody where R: Read + Send + 'static
Builds a new ResponseBody
that will read the data from a Read
.
Note that this is suboptimal compared to other constructors because the length isn't known in advance.
fn from_data<D>(data: D) -> ResponseBody where D: Into<Vec<u8>>
Builds a new ResponseBody
that returns the given data.
fn from_file(file: File) -> ResponseBody
Builds a new ResponseBody
that returns the content of the given file.
fn from_string<S>(data: S) -> ResponseBody where S: Into<String>
Builds a new ResponseBody
that returns an UTF-8 string.