Struct hawk::ResponseBuilder
source · 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> 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