Struct kvarn_search::SearchEngineHandle
source · pub struct SearchEngineHandle { /* private fields */ }
Implementations§
source§impl SearchEngineHandle
impl SearchEngineHandle
sourcepub async fn index(&self, host: &Host, documents: impl Iterator<Item = String>)
pub async fn index(&self, host: &Host, documents: impl Iterator<Item = String>)
This spawns a new task for every request it makes. The requests are processed in parallell - this should return within the longest response duration.
sourcepub async fn index_all(&self, host: &Host)
pub async fn index_all(&self, host: &Host)
Indexes all the pages in host
.
Read this section of an article about how it fetches this.
sourcepub async fn watch(
&self,
host_name: impl Into<String>,
collection: Arc<HostCollection>
) -> Result<RecommendedWatcher, WatchError>
pub async fn watch( &self, host_name: impl Into<String>, collection: Arc<HostCollection> ) -> Result<RecommendedWatcher, WatchError>
Watch for changes and rebuild index/cache, only for the resources that changed.
This must be called within a Tokio runtime.
The returned [notify::RecommendedWatcher
] should not be dropped.
When it is dropped, the functionality of this function stops.
Trait Implementations§
source§impl Clone for SearchEngineHandle
impl Clone for SearchEngineHandle
source§fn clone(&self) -> SearchEngineHandle
fn clone(&self) -> SearchEngineHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more