pub struct Custom<R>(pub Status, pub R);
Expand description
Creates a response with the given status code and underlying responder.
Example
use rocket::response::status;
use rocket::http::Status;
#[get("/")]
fn handler() -> status::Custom<&'static str> {
status::Custom(Status::ImATeapot, "Hi!")
}
Tuple Fields§
§0: Status
§1: R
Trait Implementations§
source§impl<R: PartialEq> PartialEq<Custom<R>> for Custom<R>
impl<R: PartialEq> PartialEq<Custom<R>> for Custom<R>
source§impl<'r, 'o: 'r, R: Responder<'r, 'o>> Responder<'r, 'o> for Custom<R>
impl<'r, 'o: 'r, R: Responder<'r, 'o>> Responder<'r, 'o> for Custom<R>
Sets the status code of the response and then delegates the remainder of the response to the wrapped responder.
impl<R> StructuralPartialEq for Custom<R>
Auto Trait Implementations§
impl<R> RefUnwindSafe for Custom<R>where R: RefUnwindSafe,
impl<R> Send for Custom<R>where R: Send,
impl<R> Sync for Custom<R>where R: Sync,
impl<R> Unpin for Custom<R>where R: Unpin,
impl<R> UnwindSafe for Custom<R>where R: UnwindSafe,
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,
Converts
self
into a collection.