pub enum LookupOutcome {
NotLookup,
Off {
id: String,
},
Miss {
id: String,
},
Answer(LookupAnswer),
Context(LookupAnswer),
}Expand description
What a routed request does once its target is known.
Variants§
NotLookup
The target is the backbone or an ordinary skill: run its lane.
Off
The target is a lookup record but the mode is off: the backbone
runs the plain message.
Miss
A lookup record, no key in the message: the backbone runs the plain message — unchanged, bit-identical to F0.
Answer(LookupAnswer)
answer mode: the table’s text IS the answer; nothing runs.
Context(LookupAnswer)
context mode: the backbone runs context_prompt(card, message).
Implementations§
Source§impl LookupOutcome
impl LookupOutcome
Sourcepub fn hit(&self) -> Option<&LookupAnswer>
pub fn hit(&self) -> Option<&LookupAnswer>
The table’s answer when a key was found (either mode).
pub fn is_hit(&self) -> bool
Sourcepub fn generation_text(&self, user_text: &str) -> String
pub fn generation_text(&self, user_text: &str) -> String
The text the backbone generates from (context mode prepends the
card; everything else keeps user_text).
Sourcepub fn describe(&self) -> Option<String>
pub fn describe(&self) -> Option<String>
One human line for a lookup target (None for Self::NotLookup).
Sourcepub fn lookup_id(&self) -> Option<&str>
pub fn lookup_id(&self) -> Option<&str>
The lookup record the router decided on (Off, Miss and the
hits), None for any other target.
Sourcepub fn decided_by(&self) -> Option<DecidedBy>
pub fn decided_by(&self) -> Option<DecidedBy>
Who sent the request to the lookup record (None for
Self::NotLookup): a hit says, Off / Miss come only from the
decision the lookup step was handed (the key_first policy takes a
request only when the table answers it).
Sourcepub fn annotate(&self, summary: &mut Value, mode: LookupMode)
pub fn annotate(&self, summary: &mut Value, mode: LookupMode)
Adds the lookup fields to a route summary
(RouteDecision::summary_json): lookup_hit; whenever the
target was a lookup record lookup_mode, decided_target (the
record the decision chose — target is the lane that ran, the
backbone after a miss) and decided_by (router | key_first);
on a hit lookup_key, lookup_entry, lookup_lang, field,
lookup_match (exact | stem), lookup_turn (how many user
turns back the key was found; 0 = the message routed on),
lookup_key_words.
Trait Implementations§
Source§impl Clone for LookupOutcome
impl Clone for LookupOutcome
Source§impl Debug for LookupOutcome
impl Debug for LookupOutcome
impl Eq for LookupOutcome
Source§impl PartialEq for LookupOutcome
impl PartialEq for LookupOutcome
impl StructuralPartialEq for LookupOutcome
Auto Trait Implementations§
impl Freeze for LookupOutcome
impl RefUnwindSafe for LookupOutcome
impl Send for LookupOutcome
impl Sync for LookupOutcome
impl Unpin for LookupOutcome
impl UnsafeUnpin for LookupOutcome
impl UnwindSafe for LookupOutcome
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
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
key and return true if they are equal.