pub struct SemanticSearchService { /* private fields */ }Implementations§
Source§impl SemanticSearchService
impl SemanticSearchService
pub fn new(drive_root: impl Into<PathBuf>) -> Self
pub fn status(&self, conn: &Connection) -> Result<SemanticStatus>
Sourcepub fn model_assets_installed() -> bool
pub fn model_assets_installed() -> bool
Whether every file needed for local visual search is present.
pub async fn install_model_assets<F>( cancel: Option<&AtomicBool>, progress: F, ) -> Result<(), String>
pub fn index_stats(&self, conn: &Connection) -> Result<SemanticIndexStats>
pub fn next_pending_batch( &self, conn: &Connection, limit: usize, ) -> Result<Vec<SemanticPhotoInput>>
pub fn mark_failed(conn: &Connection, photo_id: i64, error: &str) -> Result<()>
pub fn mark_indexed( &self, conn: &mut Connection, photo_id: i64, vector: &[f32], ) -> Result<()>
pub fn index_next_batch( &self, conn: &mut Connection, runner: &mut SemanticImageRunner, limit: usize, cancel: &AtomicBool, ) -> Result<SemanticIndexBatchOutcome, String>
pub fn search_text( &self, conn: &Connection, runner: &mut SemanticModelRunner, query: &str, limit: usize, ) -> Result<Vec<SemanticCandidate>, String>
pub fn search_text_cached( &self, conn: &Connection, cache: &mut SemanticIndexCache, runner: &mut SemanticModelRunner, query: &str, limit: usize, ) -> Result<Vec<SemanticCandidate>, String>
pub fn similar_to_photo( &self, conn: &Connection, photo_id: i64, limit: usize, ) -> Result<Vec<SemanticCandidate>, String>
pub fn similar_to_photo_cached( &self, conn: &Connection, cache: &mut SemanticIndexCache, photo_id: i64, limit: usize, ) -> Result<Vec<SemanticCandidate>, String>
pub fn search_vector_cached( &self, conn: &Connection, cache: &mut SemanticIndexCache, query: &[f32], limit: usize, ) -> Result<Vec<SemanticCandidate>, String>
pub fn search_vector( &self, conn: &Connection, query: &[f32], limit: usize, ) -> Result<Vec<SemanticCandidate>, String>
pub fn image_runner() -> Result<SemanticImageRunner, String>
pub fn model_runner() -> Result<SemanticModelRunner, String>
Auto Trait Implementations§
impl Freeze for SemanticSearchService
impl RefUnwindSafe for SemanticSearchService
impl Send for SemanticSearchService
impl Sync for SemanticSearchService
impl Unpin for SemanticSearchService
impl UnsafeUnpin for SemanticSearchService
impl UnwindSafe for SemanticSearchService
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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