pub struct ResponseBuilder { /* private fields */ }
Expand description
A builder to create a Response
.
Implementations
sourceimpl ResponseBuilder
impl ResponseBuilder
sourcepub fn status_code(self, status_code: StatusCode) -> Self
pub fn status_code(self, status_code: StatusCode) -> Self
Sets the status code.
sourcepub fn content_type(self, content_type: impl Into<ContentType>) -> Self
pub fn content_type(self, content_type: impl Into<ContentType>) -> Self
Sets the content type.
sourcepub fn header<K, V>(self, key: K, val: V) -> Selfwhere
K: IntoHeaderName,
V: TryInto<HeaderValue>,
V::Error: Debug,
pub fn header<K, V>(self, key: K, val: V) -> Selfwhere
K: IntoHeaderName,
V: TryInto<HeaderValue>,
V::Error: Debug,
sourcepub fn values_mut(&mut self) -> &mut HeaderValues
pub fn values_mut(&mut self) -> &mut HeaderValues
Returns HeaderValues
mutably.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more