Struct poem::ResponseBuilder
source · [−]pub struct ResponseBuilder { /* private fields */ }
Expand description
An response builder.
Implementations
Sets the HTTP status for this response.
By default this is StatusCode::OK
.
Sets the HTTP version for this response.
By default this is Version::HTTP_11
pub fn header<K, V>(self, key: K, value: V) -> Self where
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
pub fn header<K, V>(self, key: K, value: V) -> Self where
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
Appends a header to this response builder.
Inserts a typed header to this response.
Sets the Content-Type
header on the response.
Adds an extension to this response.
Consumes this builder, using the provided body to return a constructed Response.
Auto Trait Implementations
impl !RefUnwindSafe for ResponseBuilder
impl Send for ResponseBuilder
impl Sync for ResponseBuilder
impl Unpin for ResponseBuilder
impl !UnwindSafe for ResponseBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more