pub struct ResponseBuilder<'a>(/* private fields */);
Implementations§
Source§impl<'a> ResponseBuilder<'a>
impl<'a> ResponseBuilder<'a>
Sourcepub fn from_request_header(
req_header: &'a Header,
method: &'a str,
host: &'a str,
port: u16,
path: &'a str,
) -> Self
pub fn from_request_header( req_header: &'a Header, method: &'a str, host: &'a str, port: u16, path: &'a str, ) -> Self
Generate a new Response from a request header.
This is more commonly accessed through Request::make_response
.
Sourcepub fn hash<H: Into<Option<&'a [u8]>>>(self, hash: H) -> Self
pub fn hash<H: Into<Option<&'a [u8]>>>(self, hash: H) -> Self
Set the content hash for the response.
This should always be calculated from the response payload, not copied from a header.
Trait Implementations§
Source§impl<'a> Clone for ResponseBuilder<'a>
impl<'a> Clone for ResponseBuilder<'a>
Source§fn clone(&self) -> ResponseBuilder<'a>
fn clone(&self) -> ResponseBuilder<'a>
Returns a copy 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<'a> Freeze for ResponseBuilder<'a>
impl<'a> RefUnwindSafe for ResponseBuilder<'a>
impl<'a> Send for ResponseBuilder<'a>
impl<'a> Sync for ResponseBuilder<'a>
impl<'a> Unpin for ResponseBuilder<'a>
impl<'a> UnwindSafe for ResponseBuilder<'a>
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