Struct dropshot::HttpResponseCreated
source · pub struct HttpResponseCreated<T: HttpResponseContent + Send + Sync + 'static>(pub T);
Expand description
HttpResponseCreated<T: Serialize>
wraps an object of any serializable type.
It denotes an HTTP 201 “Created” response whose body is generated by
serializing the object.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: HttpResponseContent + Send + Sync + 'static> From<HttpResponseCreated<T>> for Result<Response<Body>, HttpError>
impl<T: HttpResponseContent + Send + Sync + 'static> From<HttpResponseCreated<T>> for Result<Response<Body>, HttpError>
source§impl<T: HttpResponseContent + Send + Sync + 'static> HttpCodedResponse for HttpResponseCreated<T>
impl<T: HttpResponseContent + Send + Sync + 'static> HttpCodedResponse for HttpResponseCreated<T>
type Body = T
const STATUS_CODE: StatusCode = StatusCode::CREATED
const DESCRIPTION: &'static str = "successful creation"
source§fn for_object(body: Self::Body) -> Result<Response<Body>, HttpError>
fn for_object(body: Self::Body) -> Result<Response<Body>, HttpError>
Convenience method to produce a response based on the input
body_object
(whose specific type is defined by the implementing type)
and the STATUS_CODE specified by the implementing type. This is a default
trait method to allow callers to avoid redundant type specification.Auto Trait Implementations§
impl<T> RefUnwindSafe for HttpResponseCreated<T>where
T: RefUnwindSafe,
impl<T> Send for HttpResponseCreated<T>
impl<T> Sync for HttpResponseCreated<T>
impl<T> Unpin for HttpResponseCreated<T>where
T: Unpin,
impl<T> UnwindSafe for HttpResponseCreated<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more