#[non_exhaustive]pub struct CompletionSuggestion {
pub suggestion: String,
pub language_code: String,
pub group_id: String,
pub group_score: f64,
pub alternative_phrases: Vec<String>,
pub ranking_info: Option<RankingInfo>,
/* private fields */
}Expand description
Autocomplete suggestions that are imported from Customer.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.suggestion: StringRequired. The suggestion text.
language_code: StringBCP-47 language code of this suggestion.
group_id: StringIf two suggestions have the same groupId, they will not be returned together. Instead the one ranked higher will be returned. This can be used to deduplicate semantically identical suggestions.
group_score: f64The score of this suggestion within its group.
alternative_phrases: Vec<String>Alternative matching phrases for this suggestion.
ranking_info: Option<RankingInfo>Ranking metrics of this suggestion.
Implementations§
Source§impl CompletionSuggestion
impl CompletionSuggestion
pub fn new() -> Self
Sourcepub fn set_suggestion<T: Into<String>>(self, v: T) -> Self
pub fn set_suggestion<T: Into<String>>(self, v: T) -> Self
Sets the value of suggestion.
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
Sourcepub fn set_group_id<T: Into<String>>(self, v: T) -> Self
pub fn set_group_id<T: Into<String>>(self, v: T) -> Self
Sets the value of group_id.
Sourcepub fn set_group_score<T: Into<f64>>(self, v: T) -> Self
pub fn set_group_score<T: Into<f64>>(self, v: T) -> Self
Sets the value of group_score.
Sourcepub fn set_alternative_phrases<T, V>(self, v: T) -> Self
pub fn set_alternative_phrases<T, V>(self, v: T) -> Self
Sets the value of alternative_phrases.
Sourcepub fn set_ranking_info<T: Into<Option<RankingInfo>>>(self, v: T) -> Self
pub fn set_ranking_info<T: Into<Option<RankingInfo>>>(self, v: T) -> Self
Sets the value of ranking_info.
Note that all the setters affecting ranking_info are mutually
exclusive.
Sourcepub fn global_score(&self) -> Option<&f64>
pub fn global_score(&self) -> Option<&f64>
The value of ranking_info
if it holds a GlobalScore, None if the field is not set or
holds a different branch.
Sourcepub fn set_global_score<T: Into<f64>>(self, v: T) -> Self
pub fn set_global_score<T: Into<f64>>(self, v: T) -> Self
Sets the value of ranking_info
to hold a GlobalScore.
Note that all the setters affecting ranking_info are
mutually exclusive.
Sourcepub fn frequency(&self) -> Option<&i64>
pub fn frequency(&self) -> Option<&i64>
The value of ranking_info
if it holds a Frequency, None if the field is not set or
holds a different branch.
Sourcepub fn set_frequency<T: Into<i64>>(self, v: T) -> Self
pub fn set_frequency<T: Into<i64>>(self, v: T) -> Self
Sets the value of ranking_info
to hold a Frequency.
Note that all the setters affecting ranking_info are
mutually exclusive.
Trait Implementations§
Source§impl Clone for CompletionSuggestion
impl Clone for CompletionSuggestion
Source§fn clone(&self) -> CompletionSuggestion
fn clone(&self) -> CompletionSuggestion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more