Struct fire_http::response::ResponseBuilder
source · [−]pub struct ResponseBuilder { /* private fields */ }Expand description
A builder to create a Response.
Implementations
sourceimpl ResponseBuilder
impl ResponseBuilder
sourcepub fn new() -> ResponseBuilder
pub fn new() -> ResponseBuilder
Creates a new ResponseBuilder.
sourcepub fn version(self, version: Version) -> ResponseBuilder
pub fn version(self, version: Version) -> ResponseBuilder
Sets the http version.
sourcepub fn status_code(self, status_code: StatusCode) -> ResponseBuilder
pub fn status_code(self, status_code: StatusCode) -> ResponseBuilder
Sets the status code.
sourcepub fn content_type<T>(self, content_type: T) -> ResponseBuilder where
T: Into<ContentType>,
pub fn content_type<T>(self, content_type: T) -> ResponseBuilder where
T: Into<ContentType>,
Sets the content type.
sourcepub fn header<K, V>(self, key: K, val: V) -> ResponseBuilder where
K: IntoHeaderName,
V: IntoHeaderValue,
pub fn header<K, V>(self, key: K, val: V) -> ResponseBuilder where
K: IntoHeaderName,
V: IntoHeaderValue,
sourcepub fn values_mut(&mut self) -> &mut HeaderValues
pub fn values_mut(&mut self) -> &mut HeaderValues
Returns HeaderValues mutably.
sourcepub fn body<B>(self, body: B) -> ResponseBuilder where
B: Into<Body>,
pub fn body<B>(self, body: B) -> ResponseBuilder where
B: Into<Body>,
Sets the body dropping the previous one.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more