Struct hawk::PayloadHasher
source · pub struct PayloadHasher(/* private fields */);
Expand description
A utility for hashing payloads. Feed your entity body to this, then pass the finish
result to a request or response.
Implementations§
source§impl PayloadHasher
impl PayloadHasher
sourcepub fn new<B>(content_type: B, algorithm: DigestAlgorithm) -> Result<Self>
pub fn new<B>(content_type: B, algorithm: DigestAlgorithm) -> Result<Self>
Create a new PayloadHasher. The content_type
should be lower-case and should
not include parameters. The digest is assumed to be the same as the digest used
for the credentials in the request.
sourcepub fn hash<B1, B2>(
content_type: B1,
algorithm: DigestAlgorithm,
payload: B2
) -> Result<Vec<u8>>
pub fn hash<B1, B2>( content_type: B1, algorithm: DigestAlgorithm, payload: B2 ) -> Result<Vec<u8>>
Hash a single value and return it
Auto Trait Implementations§
impl !RefUnwindSafe for PayloadHasher
impl Send for PayloadHasher
impl Sync for PayloadHasher
impl Unpin for PayloadHasher
impl !UnwindSafe for PayloadHasher
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