pub struct DigestBuilder { /* private fields */ }Expand description
Incremental digest builder for computing digests over multiple fields.
Use this when the digest domain spans multiple fields and you want to hash them incrementally without allocating a single concatenated buffer.
Implementations§
Source§impl DigestBuilder
impl DigestBuilder
Sourcepub fn update_str(&mut self, data: &str) -> &mut Self
pub fn update_str(&mut self, data: &str) -> &mut Self
Feed a UTF-8 string into the digest.
Sourcepub fn separator(&mut self) -> &mut Self
pub fn separator(&mut self) -> &mut Self
Feed a field separator. Use between fields to prevent ambiguity.
Sourcepub fn update_json<T: Serialize + ?Sized>(
&mut self,
value: &T,
) -> Result<&mut Self, DigestError>
pub fn update_json<T: Serialize + ?Sized>( &mut self, value: &T, ) -> Result<&mut Self, DigestError>
Feed a JSON-serializable value using canonical serialization.
Sourcepub fn finalize(self) -> ContentDigest
pub fn finalize(self) -> ContentDigest
Finalize and return the digest.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DigestBuilder
impl RefUnwindSafe for DigestBuilder
impl Send for DigestBuilder
impl Sync for DigestBuilder
impl Unpin for DigestBuilder
impl UnsafeUnpin for DigestBuilder
impl UnwindSafe for DigestBuilder
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