pub enum Answer {
Choice {
choice: String,
confidence: f64,
probabilities: BTreeMap<String, f64>,
},
Score {
score: f64,
confidence: f64,
legend: BTreeMap<String, String>,
probabilities: BTreeMap<String, f64>,
},
Noul {
noul: f64,
},
}Expand description
The answer to a single Question.
Internally tagged on type, mirroring Question. Kept strict — no
catch-all variant — because #[serde(other)] only applies to unit
variants in an internally-tagged enum, so a new field on an existing
answer (which serde already ignores by default) is the free extension
path; a genuinely new type is a hard-error case that should name the
unrecognised value and suggest upgrading omni-dev, not silently swallow
it into a catch-all.
Variants§
Choice
The chosen option, with per-option probabilities.
Fields
Score
The scored level, with a legend and per-level probabilities.
Fields
Noul
The estimated yes/no probability.
Deliberately has no confidence field — verified against a live
response; unlike choice/score, noul’s single probability value
already is its own confidence.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Answer
impl<'de> Deserialize<'de> for Answer
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>,
impl StructuralPartialEq for Answer
Auto Trait Implementations§
impl Freeze for Answer
impl RefUnwindSafe for Answer
impl Send for Answer
impl Sync for Answer
impl Unpin for Answer
impl UnsafeUnpin for Answer
impl UnwindSafe for Answer
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more