pub struct HttpResponseBuilder { /* private fields */ }
Expand description
Builder for HttpResponse
.
Implementations§
Source§impl HttpResponseBuilder
impl HttpResponseBuilder
pub fn status(&mut self, value: i32) -> &mut Self
pub fn body(&mut self, value: String) -> &mut Self
Sourcepub fn headers<VALUE: Into<Headers>>(&mut self, value: VALUE) -> &mut Self
pub fn headers<VALUE: Into<Headers>>(&mut self, value: VALUE) -> &mut Self
Optional headers. Mostly used by HTTP downstream HTTP responses
pub fn flow_control_headers<VALUE: Into<FlowControlHeaders>>( &mut self, value: VALUE, ) -> &mut Self
pub fn local_cache<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Sourcepub fn build(&self) -> Result<HttpResponse, HttpResponseBuilderError>
pub fn build(&self) -> Result<HttpResponse, HttpResponseBuilderError>
Trait Implementations§
Source§impl Clone for HttpResponseBuilder
impl Clone for HttpResponseBuilder
Source§fn clone(&self) -> HttpResponseBuilder
fn clone(&self) -> HttpResponseBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for HttpResponseBuilder
impl RefUnwindSafe for HttpResponseBuilder
impl !Send for HttpResponseBuilder
impl !Sync for HttpResponseBuilder
impl Unpin for HttpResponseBuilder
impl UnwindSafe for HttpResponseBuilder
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