#[non_exhaustive]pub enum Answer {
Noul(NoulAnswer),
Choice(ChoiceAnswer),
Score(ScoreAnswer),
}Expand description
One answer, tagged with the type of the question that produced it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Noul(NoulAnswer)
Answer to a Noul question.
Choice(ChoiceAnswer)
Answer to a Choice question.
Score(ScoreAnswer)
Answer to a Score question.
Implementations§
Source§impl Answer
impl Answer
Sourcepub const fn as_noul(&self) -> Option<f64>
pub const fn as_noul(&self) -> Option<f64>
The yes-probability, if this answers a Noul question.
Sourcepub const fn as_choice(&self) -> Option<&ChoiceAnswer>
pub const fn as_choice(&self) -> Option<&ChoiceAnswer>
The choice answer, if this answers a Choice question.
Sourcepub const fn as_score(&self) -> Option<&ScoreAnswer>
pub const fn as_score(&self) -> Option<&ScoreAnswer>
The score answer, if this answers a Score question.
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more