Struct zircon::prelude::Response
[−]
[src]
pub struct Response { pub origin: HyperResponse, }
Response represents http response.
Fields
origin: HyperResponse
Hyper original response.
Methods
impl Response
[src]
fn new() -> Response
[src]
Creates a fresh response.
fn render(self) -> HandlerResult
[src]
Converts Response to HandlerResult. You need to call render() after building Response.
fn text<T: Into<String>>(text: T) -> Response
[src]
Creates a Response that contains only text.
fn json<T: Into<String>>(obj: T) -> Response
[src]
Creates a json Response.
fn redirect(url: &str) -> Response
[src]
Creates a Response for redirect.
fn with_header<H: Header>(self, h: H) -> Response
[src]
Set header in Response. Use like a builder pattern.
fn with_status(self, status: StatusCode) -> Response
[src]
Set status code in Response. Use like a builder pattern.
Trait Implementations
impl SetCookieJar for Response
[src]
impl RenderFile for Response
[src]
fn render_file<P: AsRef<Path>>(self, path: P) -> HandlerResult
[src]
impl RenderTemplate for Response
[src]
fn render_html_template(
self,
engine: &HandlebarsEngine,
name: &str,
data: &Json
) -> HandlerResult
[src]
self,
engine: &HandlebarsEngine,
name: &str,
data: &Json
) -> HandlerResult