pub struct KeyHit {
pub key: String,
pub hash: u64,
pub entry: u32,
pub words: usize,
pub source: KeySource,
pub via: MatchVia,
pub stem: Option<String>,
pub turn: usize,
pub strong: bool,
}Expand description
A key found in a user message.
Fields§
§key: StringThe normalised text of the message that matched (cmf-key-v2): the
key itself for an exact hit, the inflected n-gram for a stem hit.
hash: u64The hash that hit: of key for an exact match, of stem for a
stem match.
entry: u32The entry the key names.
words: usizeWords in the key.
source: KeySource§via: MatchVia§stem: Option<String>The stemmed n-gram that hit the stem index (stem matches only).
turn: usizeHow many user turns back the key was found: 0 = the message the
request was routed on (LookupTable::find_answer_turns).
strong: boolA STRONG key (is_strong_key): the key_first policy acts on
it, and every search prefers it over a weak one.
Trait Implementations§
impl Eq for KeyHit
impl StructuralPartialEq for KeyHit
Auto Trait Implementations§
impl Freeze for KeyHit
impl RefUnwindSafe for KeyHit
impl Send for KeyHit
impl Sync for KeyHit
impl Unpin for KeyHit
impl UnsafeUnpin for KeyHit
impl UnwindSafe for KeyHit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.