pub struct TextHash(pub u64);Expand description
A fast, deterministic hash for text content.
Uses a simple FxHash-style accumulator. This is NOT cryptographically secure but is fast and sufficient for cache keying.
Tuple Fields§
§0: u64Implementations§
Source§impl TextHash
impl TextHash
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Computes a hash from a byte slice.
Sourcepub fn from_string(text: &str) -> Self
pub fn from_string(text: &str) -> Self
Computes a hash from a string.
Trait Implementations§
impl Copy for TextHash
impl Eq for TextHash
impl StructuralPartialEq for TextHash
Auto Trait Implementations§
impl Freeze for TextHash
impl RefUnwindSafe for TextHash
impl Send for TextHash
impl Sync for TextHash
impl Unpin for TextHash
impl UnsafeUnpin for TextHash
impl UnwindSafe for TextHash
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