pub struct ModalityIndex {
pub entries: HashMap<u32, Modality>,
}Expand description
Sidecar index mapping block indices to modality metadata.
Fields§
§entries: HashMap<u32, Modality>Implementations§
Source§impl ModalityIndex
impl ModalityIndex
pub fn load_or_init(output_dir: &Path) -> Self
pub fn save(&self, output_dir: &Path) -> Result<(), String>
Sourcepub fn search_image_similar(
&self,
phash: &[u8; 8],
max_distance: u32,
) -> Vec<(u32, u32)>
pub fn search_image_similar( &self, phash: &[u8; 8], max_distance: u32, ) -> Vec<(u32, u32)>
Search by perceptual hash similarity (hamming distance). Returns Vec of (block_idx, hamming_distance), sorted by distance.
Sourcepub fn search_audio_similar(
&self,
fingerprint: &[u8; 16],
threshold: f32,
) -> Vec<(u32, f32)>
pub fn search_audio_similar( &self, fingerprint: &[u8; 16], threshold: f32, ) -> Vec<(u32, f32)>
Search by spectral fingerprint similarity. Returns Vec of (block_idx, similarity_score), sorted by score descending.
Sourcepub fn search_structured(&self, field: &str, value: &FieldValue) -> Vec<u32>
pub fn search_structured(&self, field: &str, value: &FieldValue) -> Vec<u32>
Search structured data by field name and value.
Sourcepub fn modality_coords(modality: &Modality) -> (f32, f32, f32)
pub fn modality_coords(modality: &Modality) -> (f32, f32, f32)
Compute spatial coordinates for a modality. Images: from phash, Audio: from spectral features, Structured: from field hashing.
pub fn stats(&self) -> ModalityStats
Auto Trait Implementations§
impl Freeze for ModalityIndex
impl RefUnwindSafe for ModalityIndex
impl Send for ModalityIndex
impl Sync for ModalityIndex
impl Unpin for ModalityIndex
impl UnsafeUnpin for ModalityIndex
impl UnwindSafe for ModalityIndex
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