pub struct TemporalWindow {
pub hashes: Vec<u64>,
pub start_idx: usize,
pub duration_ms: u64,
}Expand description
A sliding window of SegmentFingerprint hashes used for temporal matching.
Fields§
§hashes: Vec<u64>Hashes extracted from the fingerprints in this window.
start_idx: usizeIndex in the original sequence where this window starts.
duration_ms: u64Total duration covered by this window (sum of segment durations), ms.
Implementations§
Source§impl TemporalWindow
impl TemporalWindow
Sourcepub fn from_fingerprints(fps: &[SegmentFingerprint], start_idx: usize) -> Self
pub fn from_fingerprints(fps: &[SegmentFingerprint], start_idx: usize) -> Self
Create a window from a slice of fingerprints at a given start index.
Sourcepub fn similarity(&self, other: &Self) -> f32
pub fn similarity(&self, other: &Self) -> f32
Compare this window to another by average Hamming similarity.
Returns 0.0 if either window is empty or they have different lengths.
Trait Implementations§
Source§impl Clone for TemporalWindow
impl Clone for TemporalWindow
Source§fn clone(&self) -> TemporalWindow
fn clone(&self) -> TemporalWindow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TemporalWindow
impl RefUnwindSafe for TemporalWindow
impl Send for TemporalWindow
impl Sync for TemporalWindow
impl Unpin for TemporalWindow
impl UnsafeUnpin for TemporalWindow
impl UnwindSafe for TemporalWindow
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more