pub struct SearchEngineSelector(/* private fields */);
Expand description
SearchEngineSelector parses the JSON configuration for search engines and returns the applicable engines depending on their region + locale.
Implementations§
source§impl SearchEngineSelector
impl SearchEngineSelector
pub fn new() -> Self
sourcepub fn set_search_config(
self: Arc<Self>,
configuration: String,
) -> SearchApiResult<()>
pub fn set_search_config( self: Arc<Self>, configuration: String, ) -> SearchApiResult<()>
Sets the search configuration from the given string. If the configuration string is unchanged since the last update, the cached configuration is reused to avoid unnecessary reprocessing. This helps optimize performance, particularly during test runs where the same configuration may be used repeatedly.
sourcepub fn clear_search_config(self: Arc<Self>)
pub fn clear_search_config(self: Arc<Self>)
Clears the search configuration from memory if it is known that it is not required for a time, e.g. if the configuration will only be re-filtered after an app/environment update.
sourcepub fn filter_engine_configuration(
self: Arc<Self>,
user_environment: SearchUserEnvironment,
) -> SearchApiResult<RefinedSearchConfig>
pub fn filter_engine_configuration( self: Arc<Self>, user_environment: SearchUserEnvironment, ) -> SearchApiResult<RefinedSearchConfig>
Filters the search configuration with the user’s given environment, and returns the set of engines and parameters that should be presented to the user.
Trait Implementations§
source§impl Default for SearchEngineSelector
impl Default for SearchEngineSelector
source§fn default() -> SearchEngineSelector
fn default() -> SearchEngineSelector
source§impl<UT> LiftRef<UT> for SearchEngineSelector
impl<UT> LiftRef<UT> for SearchEngineSelector
type LiftType = Arc<SearchEngineSelector>
source§impl<UT> LowerError<UT> for SearchEngineSelector
impl<UT> LowerError<UT> for SearchEngineSelector
source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
source§impl<UT> LowerReturn<UT> for SearchEngineSelector
impl<UT> LowerReturn<UT> for SearchEngineSelector
source§type ReturnType = <Arc<SearchEngineSelector> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<SearchEngineSelector> as LowerReturn<UniFfiTag>>::ReturnType
source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
source§impl<UT> TypeId<UT> for SearchEngineSelector
impl<UT> TypeId<UT> for SearchEngineSelector
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl !Freeze for SearchEngineSelector
impl !RefUnwindSafe for SearchEngineSelector
impl Send for SearchEngineSelector
impl Sync for SearchEngineSelector
impl Unpin for SearchEngineSelector
impl UnwindSafe for SearchEngineSelector
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more