use std::path::{Path, PathBuf};
use crate::Result;
#[derive(Debug)]
pub enum LookupResult<T> {
Hit(T),
Invalidated,
Miss,
}
pub trait CacheRead {
fn check(&self, path: &Path) -> Result<bool>;
fn check_all(&self, paths: &[&Path]) -> Vec<(PathBuf, Result<bool>)>;
fn list_paths(&self) -> Result<Vec<String>>;
}
#[derive(Debug, Clone)]
pub struct DirCacheSummary {
pub dir_path: String,
pub file_count: usize,
pub total_size: u64,
pub latest_cached_at: i64,
}
#[derive(Debug)]
pub struct UpsertImageRequest {
pub path: PathBuf,
pub clip_vector: Option<Vec<f32>>,
}
#[derive(Clone, Debug)]
pub struct ImageCacheEntry {
pub path: String,
pub thumbnail_path: Option<String>,
pub features: Option<ImageFeatures>,
}
#[derive(Clone, Debug, PartialEq)]
pub struct ImageFeatures {
pub clip_vector: Vec<f32>,
}
#[derive(Debug)]
pub struct UpsertVideoRequest {
pub path: PathBuf,
pub clip_vector: Option<Vec<f32>>,
pub wav2vec2_vector: Option<Vec<f32>>,
}
#[derive(Debug)]
pub struct VideoCacheEntry {
pub path: String,
pub thumbnail_path: Option<String>,
pub features: Option<VideoFeatures>,
}
#[derive(Debug, PartialEq)]
pub struct VideoFeatures {
pub clip_vector: Option<Vec<f32>>,
pub wav2vec2_vector: Option<Vec<f32>>,
}