pub struct SegmentDeduplicator { /* private fields */ }Expand description
Performs segment-level deduplication over a corpus of media segments.
Implementations§
Source§impl SegmentDeduplicator
impl SegmentDeduplicator
Sourcepub fn with_config(config: SegmentDedupConfig) -> Self
pub fn with_config(config: SegmentDedupConfig) -> Self
Create a new deduplicator with explicit configuration.
Sourcepub fn add_segment(
&mut self,
source_id: &str,
frame_offset: usize,
bytes: &[u8],
)
pub fn add_segment( &mut self, source_id: &str, frame_offset: usize, bytes: &[u8], )
Add a segment identified by source_id starting at frame_offset
with the given raw bytes (representing that segment’s content).
Sourcepub fn find_duplicates(&self) -> Vec<Vec<&SegmentRecord>>
pub fn find_duplicates(&self) -> Vec<Vec<&SegmentRecord>>
Find all duplicate segment groups (groups where 2+ sources share a hash).
Sourcepub fn unique_count(&self) -> usize
pub fn unique_count(&self) -> usize
Returns the number of unique segment hashes stored.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Returns the total number of segment records stored.
Sourcepub fn config(&self) -> &SegmentDedupConfig
pub fn config(&self) -> &SegmentDedupConfig
Returns the underlying config.
Trait Implementations§
Source§impl Debug for SegmentDeduplicator
impl Debug for SegmentDeduplicator
Source§impl Default for SegmentDeduplicator
impl Default for SegmentDeduplicator
Source§fn default() -> SegmentDeduplicator
fn default() -> SegmentDeduplicator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SegmentDeduplicator
impl RefUnwindSafe for SegmentDeduplicator
impl Send for SegmentDeduplicator
impl Sync for SegmentDeduplicator
impl Unpin for SegmentDeduplicator
impl UnsafeUnpin for SegmentDeduplicator
impl UnwindSafe for SegmentDeduplicator
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> 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