pub struct ContentFingerprint {
pub full_hash: u64,
pub content_hash: u64,
pub text_hash: u64,
pub structure_hash: u64,
pub element_count: usize,
pub text_node_count: usize,
pub content_length: usize,
pub main_content_length: usize,
}Expand description
Content fingerprint for change detection
Fields§
§full_hash: u64Hash of the full HTML content
content_hash: u64Hash of just the main content (excluding nav, footer, etc.)
text_hash: u64Hash of the text content only (no tags)
structure_hash: u64Hash of the document structure (tag hierarchy)
element_count: usizeNumber of elements in the document
text_node_count: usizeNumber of text nodes
content_length: usizeContent length in bytes
main_content_length: usizeMain content length
Implementations§
Source§impl ContentFingerprint
impl ContentFingerprint
Sourcepub fn has_changed(&self, other: &ContentFingerprint) -> bool
pub fn has_changed(&self, other: &ContentFingerprint) -> bool
Check if content has changed compared to another fingerprint
Sourcepub fn has_minor_changes(&self, other: &ContentFingerprint) -> bool
pub fn has_minor_changes(&self, other: &ContentFingerprint) -> bool
Check if only minor changes occurred (same structure, different content)
Sourcepub fn has_structural_changes(&self, other: &ContentFingerprint) -> bool
pub fn has_structural_changes(&self, other: &ContentFingerprint) -> bool
Check if structure changed (major change)
Sourcepub fn similarity(&self, other: &ContentFingerprint) -> f64
pub fn similarity(&self, other: &ContentFingerprint) -> f64
Get similarity percentage (0.0 to 1.0)
Trait Implementations§
Source§impl Clone for ContentFingerprint
impl Clone for ContentFingerprint
Source§fn clone(&self) -> ContentFingerprint
fn clone(&self) -> ContentFingerprint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentFingerprint
impl Debug for ContentFingerprint
Source§impl Default for ContentFingerprint
impl Default for ContentFingerprint
Source§fn default() -> ContentFingerprint
fn default() -> ContentFingerprint
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContentFingerprint
impl<'de> Deserialize<'de> for ContentFingerprint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContentFingerprint
impl PartialEq for ContentFingerprint
Source§impl Serialize for ContentFingerprint
impl Serialize for ContentFingerprint
impl Eq for ContentFingerprint
impl StructuralPartialEq for ContentFingerprint
Auto Trait Implementations§
impl Freeze for ContentFingerprint
impl RefUnwindSafe for ContentFingerprint
impl Send for ContentFingerprint
impl Sync for ContentFingerprint
impl Unpin for ContentFingerprint
impl UnwindSafe for ContentFingerprint
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