Struct rocket::response::content::Content [−][src]
pub struct Content<R>(pub ContentType, pub R);
Sets the Content-Type of a Responder
to a chosen value.
Delagates the remainder of the response to the wrapped responder.
Example
Set the Content-Type of a string to PDF.
use rocket::response::content::Content; use rocket::http::ContentType; let response = Content(ContentType::PDF, "Hi.");
Trait Implementations
impl<R: Debug> Debug for Content<R>
[src]
impl<R: Debug> Debug for Content<R>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<R: Clone> Clone for Content<R>
[src]
impl<R: Clone> Clone for Content<R>
fn clone(&self) -> Content<R>
[src]
fn clone(&self) -> Content<R>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<R: PartialEq> PartialEq for Content<R>
[src]
impl<R: PartialEq> PartialEq for Content<R>
fn eq(&self, other: &Content<R>) -> bool
[src]
fn eq(&self, other: &Content<R>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Content<R>) -> bool
[src]
fn ne(&self, other: &Content<R>) -> bool
This method tests for !=
.
impl<'r, R: Responder<'r>> Responder<'r> for Content<R>
[src]
impl<'r, R: Responder<'r>> Responder<'r> for Content<R>
Overrides the Content-Type of the response to the wrapped ContentType
then
delegates the remainder of the response to the wrapped responder.