pub struct CompletionSuggestOption {
pub text: String,
pub index: String,
pub id: String,
pub score: f32,
pub source: Option<Value>,
pub contexts: BTreeMap<String, Vec<String>>,
}
Expand description
Suggester response item option
Fields§
§text: String
Suggested text
index: String
Document index
id: String
Document id
score: f32
Document score for completion suggester, suggest score for term, phrase
source: Option<Value>
Document source
Not using crate::Source due to a bug in enums and RawValue https://github.com/serde-rs/json/issues/779
contexts: BTreeMap<String, Vec<String>>
The contexts associated with the completed document
Contexts always return either as a category or as geohash
Implementations§
Source§impl CompletionSuggestOption
impl CompletionSuggestOption
Sourcepub fn parse<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn parse<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
Parses document source into a concrete type
Trait Implementations§
Source§impl Clone for CompletionSuggestOption
impl Clone for CompletionSuggestOption
Source§fn clone(&self) -> CompletionSuggestOption
fn clone(&self) -> CompletionSuggestOption
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CompletionSuggestOption
impl Debug for CompletionSuggestOption
Source§impl<'de> Deserialize<'de> for CompletionSuggestOption
impl<'de> Deserialize<'de> for CompletionSuggestOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CompletionSuggestOption
impl PartialEq for CompletionSuggestOption
Source§impl Serialize for CompletionSuggestOption
impl Serialize for CompletionSuggestOption
impl StructuralPartialEq for CompletionSuggestOption
Auto Trait Implementations§
impl Freeze for CompletionSuggestOption
impl RefUnwindSafe for CompletionSuggestOption
impl Send for CompletionSuggestOption
impl Sync for CompletionSuggestOption
impl Unpin for CompletionSuggestOption
impl UnwindSafe for CompletionSuggestOption
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
Mutably borrows from an owned value. Read more