pub struct WebSearchEngine { /* private fields */ }Expand description
Web Search Engine
Implementations§
Source§impl WebSearchEngine
impl WebSearchEngine
Sourcepub fn with_config(config: WebSearchConfig) -> Self
pub fn with_config(config: WebSearchConfig) -> Self
Create a new web search engine with custom configuration.
Providers are instantiated from the typed registry (the single source of truth), so every catalogued engine — class-based, descriptor-driven, and web-capture-backed — is available for selection.
Sourcepub async fn search(
&self,
query: &str,
options: SearchOptions,
) -> Result<Vec<SearchResult>, SearchError>
pub async fn search( &self, query: &str, options: SearchOptions, ) -> Result<Vec<SearchResult>, SearchError>
Search across multiple providers
Sourcepub async fn search_with_options(
&self,
query: &str,
options: SearchOptions,
providers: Option<Vec<String>>,
merge_options: Option<MergeOptions>,
) -> Result<Vec<SearchResult>, SearchError>
pub async fn search_with_options( &self, query: &str, options: SearchOptions, providers: Option<Vec<String>>, merge_options: Option<MergeOptions>, ) -> Result<Vec<SearchResult>, SearchError>
Search with additional merge options
Sourcepub async fn search_detailed_with_options(
&self,
query: &str,
options: SearchOptions,
providers: Option<Vec<String>>,
merge_options: Option<MergeOptions>,
transport: Arc<dyn SearchTransport>,
) -> DetailedSearchResult
pub async fn search_detailed_with_options( &self, query: &str, options: SearchOptions, providers: Option<Vec<String>>, merge_options: Option<MergeOptions>, transport: Arc<dyn SearchTransport>, ) -> DetailedSearchResult
Search through a caller-owned transport and retain per-provider errors and exact response bytes. These provider futures are not spawned: when the returned future is dropped, all in-flight work is dropped with it.
Sourcepub async fn search_single(
&self,
query: &str,
provider_name: &str,
options: SearchOptions,
) -> Result<Vec<SearchResult>, SearchError>
pub async fn search_single( &self, query: &str, provider_name: &str, options: SearchOptions, ) -> Result<Vec<SearchResult>, SearchError>
Search with a single provider
Sourcepub async fn search_single_with_transport(
&self,
query: &str,
provider_name: &str,
options: SearchOptions,
transport: &dyn SearchTransport,
) -> Result<Vec<SearchResult>, SearchError>
pub async fn search_single_with_transport( &self, query: &str, provider_name: &str, options: SearchOptions, transport: &dyn SearchTransport, ) -> Result<Vec<SearchResult>, SearchError>
Search one provider through a caller-owned transport.
Sourcepub fn get_available_providers(&self) -> Vec<String>
pub fn get_available_providers(&self) -> Vec<String>
Get available provider names
Sourcepub fn get_registry(&self) -> &[RegistryEntry]
pub fn get_registry(&self) -> &[RegistryEntry]
Get the full provider registry (metadata for every known provider).
Sourcepub async fn get_provider_status(&self) -> HashMap<String, ProviderStatus>
pub async fn get_provider_status(&self) -> HashMap<String, ProviderStatus>
Get provider status, enriched with registry metadata (category, label, CORS readability, access mechanism) so callers see the same shape the JavaScript implementation exposes.
Sourcepub async fn set_provider_weight(
&self,
name: &str,
weight: f64,
) -> Result<(), SearchError>
pub async fn set_provider_weight( &self, name: &str, weight: f64, ) -> Result<(), SearchError>
Set provider weight
Sourcepub async fn set_provider_enabled(
&self,
name: &str,
enabled: bool,
) -> Result<(), SearchError>
pub async fn set_provider_enabled( &self, name: &str, enabled: bool, ) -> Result<(), SearchError>
Enable or disable a provider