pub struct ContentDedup { /* private fields */ }Expand description
Deduplication by content (hash + simhash)
Implementations§
Source§impl ContentDedup
impl ContentDedup
Sourcepub fn hash_content(content: &str) -> String
pub fn hash_content(content: &str) -> String
SHA-256 hash of content
Sourcepub fn hamming_distance(a: u64, b: u64) -> u32
pub fn hamming_distance(a: u64, b: u64) -> u32
Hamming distance between two simhashes
Sourcepub fn is_exact_duplicate(&self, content: &str) -> bool
pub fn is_exact_duplicate(&self, content: &str) -> bool
Check if content is an exact duplicate
Sourcepub fn is_near_duplicate(&self, content: &str) -> bool
pub fn is_near_duplicate(&self, content: &str) -> bool
Check if content is a near-duplicate
Sourcepub fn is_duplicate(&self, content: &str) -> bool
pub fn is_duplicate(&self, content: &str) -> bool
Check if duplicate (exact or near)
Sourcepub fn check_and_mark(&self, content: &str) -> bool
pub fn check_and_mark(&self, content: &str) -> bool
Check and mark in one operation
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ContentDedup
impl RefUnwindSafe for ContentDedup
impl Send for ContentDedup
impl Sync for ContentDedup
impl Unpin for ContentDedup
impl UnwindSafe for ContentDedup
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