Struct rocket::response::status::Custom [−][src]
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!") }
Trait Implementations
Sets the status code of the response and then delegates the remainder of the response to the wrapped responder.
Returns Ok
if a Response
could be generated successfully. Otherwise,
returns an Err
with a failing Status
. Read more
Auto Trait Implementations
impl<R> RefUnwindSafe for Custom<R> where
R: RefUnwindSafe,
impl<R> UnwindSafe for Custom<R> where
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Converts self
into a collection.
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V