Struct rocket::response::status::BadRequest [−][src]
pub struct BadRequest<R>(pub Option<R>);
Sets the status of the response to 400 (Bad Request).
If a responder is supplied, the remainder of the response is delegated to it. If there is no responder, the body of the response will be empty.
Examples
A 400 Bad Request response without a body:
use rocket::response::status; let response = status::BadRequest::<()>(None);
A 400 Bad Request response with a body:
use rocket::response::status; let response = status::BadRequest(Some("error message"));
Trait Implementations
impl<R: Debug> Debug for BadRequest<R>
[src]
impl<R: Debug> Debug for BadRequest<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 BadRequest<R>
[src]
impl<R: Clone> Clone for BadRequest<R>
fn clone(&self) -> BadRequest<R>
[src]
fn clone(&self) -> BadRequest<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 BadRequest<R>
[src]
impl<R: PartialEq> PartialEq for BadRequest<R>
fn eq(&self, other: &BadRequest<R>) -> bool
[src]
fn eq(&self, other: &BadRequest<R>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BadRequest<R>) -> bool
[src]
fn ne(&self, other: &BadRequest<R>) -> bool
This method tests for !=
.
impl<'r, R: Responder<'r>> Responder<'r> for BadRequest<R>
[src]
impl<'r, R: Responder<'r>> Responder<'r> for BadRequest<R>
Sets the status code of the response to 400 Bad Request. If the responder is
Some
, it is used to finalize the response.
Auto Trait Implementations
impl<R> Send for BadRequest<R> where
R: Send,
impl<R> Send for BadRequest<R> where
R: Send,
impl<R> Sync for BadRequest<R> where
R: Sync,
impl<R> Sync for BadRequest<R> where
R: Sync,