pub struct FingerprintBuilder { /* private fields */ }Expand description
Length-delimited deterministic SHA-256 input builder.
Implementations§
Source§impl FingerprintBuilder
impl FingerprintBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Starts a fingerprint with a domain-separation marker and 512 MiB field budget.
Sourcepub fn with_max_bytes(max_bytes: usize) -> Result<Self>
pub fn with_max_bytes(max_bytes: usize) -> Result<Self>
Starts a fingerprint with an aggregate budget for all framed fields.
Sourcepub fn field(&mut self, name: &str, bytes: &[u8]) -> Result<()>
pub fn field(&mut self, name: &str, bytes: &[u8]) -> Result<()>
Adds one named byte field with unambiguous length boundaries.
Sourcepub fn serialized<T: Serialize>(&mut self, name: &str, value: &T) -> Result<()>
pub fn serialized<T: Serialize>(&mut self, name: &str, value: &T) -> Result<()>
Serializes canonical field-order JSON directly into the digest.
Serialization runs once for bounded sizing and once for hashing so the
length prefix can precede the payload without retaining a JSON buffer.
Custom Serialize implementations must produce the same bytes in both
passes; a size change fails without mutating the builder.
Sourcepub fn finish(self) -> DocumentFingerprint
pub fn finish(self) -> DocumentFingerprint
Finishes the digest.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FingerprintBuilder
impl RefUnwindSafe for FingerprintBuilder
impl Send for FingerprintBuilder
impl Sync for FingerprintBuilder
impl Unpin for FingerprintBuilder
impl UnsafeUnpin for FingerprintBuilder
impl UnwindSafe for FingerprintBuilder
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
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.