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.


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>

Formats the value using the given formatter. Read more

impl<R: Clone> Clone for BadRequest<R>

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<R: PartialEq> PartialEq for BadRequest<R>

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more

Auto Trait Implementations

impl<R> Send for BadRequest<R> where
    R: Send

impl<R> Sync for BadRequest<R> where
    R: Sync