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 use_remote_settings_server(
self: Arc<Self>,
service: &Arc<RemoteSettingsService>,
apply_engine_overrides: bool,
) -> SearchApiResult<()>
pub fn use_remote_settings_server( self: Arc<Self>, service: &Arc<RemoteSettingsService>, apply_engine_overrides: bool, ) -> SearchApiResult<()>
Sets the RemoteSettingsService to use. The selector will create the relevant remote settings client(s) from the service.
§Params:
service
: The remote settings service instance for the application.options
: The remote settings options to be passed to the client(s).apply_engine_overrides
: Whether or not to apply overrides fromsearch-config-v2-overrides
to the selected engines. Should be false unless the application supports the click URL feature.
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.
pub fn set_config_overrides( self: Arc<Self>, overrides: String, ) -> SearchApiResult<()>
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