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_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 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
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WebSearchEngine
impl !UnwindSafe for WebSearchEngine
impl Freeze for WebSearchEngine
impl Send for WebSearchEngine
impl Sync for WebSearchEngine
impl Unpin for WebSearchEngine
impl UnsafeUnpin for WebSearchEngine
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