pub struct WebCaptureProvider { /* private fields */ }Expand description
Provider that delegates to the web-capture component library.
Implementations§
Source§impl WebCaptureProvider
impl WebCaptureProvider
Sourcepub fn new(engine: impl Into<String>) -> Self
pub fn new(engine: impl Into<String>) -> Self
Create a provider bound to a web-capture engine (default wikipedia).
Sourcepub fn adapt_items(&self, items: Vec<SearchResultItem>) -> Vec<SearchResult>
pub fn adapt_items(&self, items: Vec<SearchResultItem>) -> Vec<SearchResult>
Adapt normalized web-capture items into the web-search result contract.
Trait Implementations§
Source§impl Default for WebCaptureProvider
impl Default for WebCaptureProvider
Source§impl SearchProvider for WebCaptureProvider
impl SearchProvider for WebCaptureProvider
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if the provider is available/enabled
Source§fn set_weight(&mut self, weight: f64)
fn set_weight(&mut self, weight: f64)
Set the provider weight for reranking
Source§fn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Enable or disable the provider
Source§fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 SearchOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, SearchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 SearchOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, SearchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Perform a search with the provider’s default transport.
Source§fn search_with_transport<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 SearchOptions,
transport: &'life3 dyn SearchTransport,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, SearchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn search_with_transport<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 SearchOptions,
transport: &'life3 dyn SearchTransport,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>, SearchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Perform a search with a caller-owned transport. Read more
Auto Trait Implementations§
impl Freeze for WebCaptureProvider
impl RefUnwindSafe for WebCaptureProvider
impl Send for WebCaptureProvider
impl Sync for WebCaptureProvider
impl Unpin for WebCaptureProvider
impl UnsafeUnpin for WebCaptureProvider
impl UnwindSafe for WebCaptureProvider
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