Struct merino_suggest_traits::NullProvider
source · [−]pub struct NullProvider;
Expand description
A basic provider that never returns any suggestions.
Trait Implementations
sourceimpl SuggestionProvider for NullProvider
impl SuggestionProvider for NullProvider
sourcefn cache_inputs(&self, _req: &SuggestionRequest, _hasher: &mut dyn CacheInputs)
fn cache_inputs(&self, _req: &SuggestionRequest, _hasher: &mut dyn CacheInputs)
Generate a set of cache inputs for a given query specific to this provider. Any property of the query that affects how suggestions are generated should be included. Read more
sourcefn is_null(&self) -> bool
fn is_null(&self) -> bool
Return if this provider is null and can be ignored. Providers that set this to true should be ignored in any place where suggestions are needed. Providers with this set to true likely only serve as a blank space where we may need a provider but can’t otherwise supply one. Read more
sourcefn suggest<'life0, 'async_trait>(
&'life0 self,
_query: SuggestionRequest
) -> Pin<Box<dyn Future<Output = Result<SuggestionResponse, SuggestError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn suggest<'life0, 'async_trait>(
&'life0 self,
_query: SuggestionRequest
) -> Pin<Box<dyn Future<Output = Result<SuggestionResponse, SuggestError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Provide suggested results for query
.
sourcefn reconfigure<'life0, 'life1, 'async_trait>(
&'life0 mut self,
new_config: Value,
_make_fresh: &'life1 MakeFreshType
) -> Pin<Box<dyn Future<Output = Result<(), SetupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn reconfigure<'life0, 'life1, 'async_trait>(
&'life0 mut self,
new_config: Value,
_make_fresh: &'life1 MakeFreshType
) -> Pin<Box<dyn Future<Output = Result<(), SetupError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Reconfigure the provider, using a new configuration object. State should be preserved if possible. Read more
sourcefn cache_key(&self, req: &SuggestionRequest) -> String
fn cache_key(&self, req: &SuggestionRequest) -> String
Use Self::cache_inputs
to generate a single cache key. This function
should not normally be overridden by provider implementations. Read more
Auto Trait Implementations
impl RefUnwindSafe for NullProvider
impl Send for NullProvider
impl Sync for NullProvider
impl Unpin for NullProvider
impl UnwindSafe for NullProvider
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more