Struct vid_dup_finder_lib::VideoHash
source · [−]pub struct VideoHash { /* private fields */ }
Expand description
A hash of a video file, used for video duplicate detection. The hash contains information about the first 30 seconds of a video, and also the duration. Searches will use these data to determine similarity.
Implementations
sourceimpl VideoHash
impl VideoHash
sourcepub fn from_path(
src_path: impl AsRef<Path>
) -> Result<Self, HashCreationErrorKind>
pub fn from_path(
src_path: impl AsRef<Path>
) -> Result<Self, HashCreationErrorKind>
Create a VideoHash from the video file at src_path.
- Returns the hash itself if successful, otherwise
- an error with the reason that the hash could not be created.
sourcepub fn levenshtein_distance(&self, other: &VideoHash) -> RawDistance
pub fn levenshtein_distance(&self, other: &VideoHash) -> RawDistance
The raw haming distance from this hash to another hash.
sourcepub fn normalized_levenshtein_distance(
&self,
other: &VideoHash
) -> NormalizedDistance
pub fn normalized_levenshtein_distance(
&self,
other: &VideoHash
) -> NormalizedDistance
The distance from this hash to another hash, but normalized into the range 0..=1
Trait Implementations
sourceimpl<'de> Deserialize<'de> for VideoHash
impl<'de> Deserialize<'de> for VideoHash
sourcefn 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
sourceimpl Ord for VideoHash
impl Ord for VideoHash
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<VideoHash> for VideoHash
impl PartialOrd<VideoHash> for VideoHash
sourcefn partial_cmp(&self, other: &VideoHash) -> Option<Ordering>
fn partial_cmp(&self, other: &VideoHash) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for VideoHash
impl StructuralEq for VideoHash
impl StructuralPartialEq for VideoHash
Auto Trait Implementations
impl RefUnwindSafe for VideoHash
impl Send for VideoHash
impl Sync for VideoHash
impl Unpin for VideoHash
impl UnwindSafe for VideoHash
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.