pub struct Response<'a> { /* private fields */ }
Expand description
A Response represents a response from an HTTP server.
The structure is created from a request and then used to either create (server) or validate
(client) a Server-Authentication
header.
Like Request
, Responses are built with ResponseBuilders
.
§Examples
See the documentation in the crate root for examples.
Implementations§
source§impl<'a> Response<'a>
impl<'a> Response<'a>
sourcepub fn make_header(&self, key: &Key) -> Result<Header>
pub fn make_header(&self, key: &Key) -> Result<Header>
Create a new Header for this response, based on the given request and request header
sourcepub fn validate_header(&self, response_header: &Header, key: &Key) -> bool
pub fn validate_header(&self, response_header: &Header, key: &Key) -> bool
Validate a Server-Authorization header.
This checks that the MAC matches and, if a hash has been supplied locally, checks that one was provided from the server and that it, too, matches.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Response<'a>
impl<'a> Send for Response<'a>
impl<'a> Sync for Response<'a>
impl<'a> Unpin for Response<'a>
impl<'a> UnwindSafe for Response<'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