/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis *file,Youcanobtainoneathttp://mozilla.org/MPL/2.0/.
*/
use std::fmt;
use rusqlite::{
types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef},
Result as RusqliteResult,
};
usecrate::rs::SuggestRecordType;
/// Record types from these providers will be ingested when consumers do not /// specify providers in `SuggestIngestionConstraints`. pub(crate) const DEFAULT_INGEST_PROVIDERS: [SuggestionProvider; 6] = [
SuggestionProvider::Amp,
SuggestionProvider::Wikipedia,
SuggestionProvider::Amo,
SuggestionProvider::Yelp,
SuggestionProvider::Mdn,
SuggestionProvider::AmpMobile,
];
/// A provider is a source of search suggestions. #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, uniffi::Enum)] #[repr(u8)] pubenum SuggestionProvider {
Amp = 1,
Wikipedia = 2,
Amo = 3,
Pocket = 4,
Yelp = 5,
Mdn = 6,
Weather = 7,
AmpMobile = 8,
Fakespot = 9,
Exposure = 10,
}
/// Some providers manage multiple suggestion subtypes. Queries, ingests, and /// other operations on those providers must be constrained to a desired subtype. #[derive(Clone, Default, Debug, uniffi::Record)] pubstruct SuggestionProviderConstraints { /// `Exposure` provider - For each desired exposure suggestion type, this /// should contain the value of the `suggestion_type` field of its remote /// settings record(s). #[uniffi(default = None)] pub exposure_suggestion_types: Option<Vec<String>>, /// Which strategy should we use for the AMP queries? /// Use None for the default strategy. #[uniffi(default = None)] pub amp_alternative_matching: Option<AmpMatchingStrategy>,
}
#[derive(Clone, Debug, uniffi::Enum)] pubenum AmpMatchingStrategy { /// Disable keywords added via keyword expansion. /// This eliminates keywords that for terms related to the "real" keywords, for example /// misspellings like "underarmor" instead of "under armor"'.
NoKeywordExpansion, /// Use FTS matching against the full keywords, joined together.
FtsAgainstFullKeywords, /// Use FTS matching against the title field
FtsAgainstTitle,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.