Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/suggest/src/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  config.rs   Sprache: unbekannt

 
Spracherkennung für: .rs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

use serde::{Deserialize, Serialize};

use crate::rs::DownloadedGlobalConfig;

/// Global Suggest configuration data.
#[derive(Clone, Default, Debug, Deserialize, Serialize, PartialEq, Eq, uniffi::Record)]
pub struct SuggestGlobalConfig {
    pub show_less_frequently_cap: i32,
}

impl From<&DownloadedGlobalConfig> for SuggestGlobalConfig {
    fn from(config: &DownloadedGlobalConfig) -> Self {
        Self {
            show_less_frequently_cap: config.configuration.show_less_frequently_cap,
        }
    }
}

/// Per-provider configuration data.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, uniffi::Enum)]
pub enum SuggestProviderConfig {
    Weather {
        /// Weather suggestion score.
        score: f64,
        /// Threshold for weather keyword prefix matching when a weather keyword
        /// is the first term in a query. Zero means prefix matching is disabled
        /// and weather keywords must be typed in full when they are first in
        /// the query. (Ideally this would be an `Option` and `None` would mean
        /// full keywords are required, but it's probably not worth the breaking
        /// API change.) This threshold does not apply to city and region names.
        min_keyword_length: i32,
    },
}

[ Dauer der Verarbeitung: 0.33 Sekunden  ]