pub struct FileRecord {
pub uri: String,
pub blake3_hex: String,
pub phash: Option<u64>,
pub duration_s: Option<f64>,
pub file_size: Option<u64>,
}Expand description
A single file entry within a node’s manifest.
Fields§
§uri: StringLogical URI for this file (e.g. "node-a:/path/to/file.mp4").
blake3_hex: StringLower-case hexadecimal BLAKE3 digest (64 hex characters).
phash: Option<u64>Optional 64-bit perceptual hash.
duration_s: Option<f64>Optional duration in seconds.
file_size: Option<u64>Optional file size in bytes.
Implementations§
Source§impl FileRecord
impl FileRecord
Sourcepub fn new(
uri: String,
blake3_hex: String,
phash: Option<u64>,
duration_s: Option<f64>,
file_size: Option<u64>,
) -> Self
pub fn new( uri: String, blake3_hex: String, phash: Option<u64>, duration_s: Option<f64>, file_size: Option<u64>, ) -> Self
Create a new FileRecord.
Sourcepub fn has_valid_digest(&self) -> bool
pub fn has_valid_digest(&self) -> bool
Return true if this record has a valid-looking Blake3 hex digest.
BLAKE3 produces 32 bytes → 64 hex characters.
Sourcepub fn phash_distance(&self, other: &Self) -> Option<u32>
pub fn phash_distance(&self, other: &Self) -> Option<u32>
Compute the Hamming distance to another record’s perceptual hash.
Returns None if either record lacks a perceptual hash.
Trait Implementations§
Source§impl Clone for FileRecord
impl Clone for FileRecord
Source§fn clone(&self) -> FileRecord
fn clone(&self) -> FileRecord
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 moreSource§impl Debug for FileRecord
impl Debug for FileRecord
Source§impl<'de> Deserialize<'de> for FileRecord
impl<'de> Deserialize<'de> for FileRecord
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
Auto Trait Implementations§
impl Freeze for FileRecord
impl RefUnwindSafe for FileRecord
impl Send for FileRecord
impl Sync for FileRecord
impl Unpin for FileRecord
impl UnsafeUnpin for FileRecord
impl UnwindSafe for FileRecord
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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