#[non_exhaustive]pub enum Answer {
Noul(NoulAnswer),
Choice(ChoiceAnswer),
Score(ScoreAnswer),
Unknown {
kind: String,
raw: Value,
},
}Expand description
Any answer, discriminated by its type field.
Unknown future types are kept losslessly as Answer::Unknown.
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)
A yes/no answer.
Choice(ChoiceAnswer)
A one-of-many selection.
Score(ScoreAnswer)
A rubric rating.
Unknown
An answer whose type this client does not know, carrying its raw
JSON and the type name.
Trait Implementations§
Source§impl From<ChoiceAnswer> for Answer
impl From<ChoiceAnswer> for Answer
Source§fn from(answer: ChoiceAnswer) -> Self
fn from(answer: ChoiceAnswer) -> Self
Converts to this type from the input type.
Source§impl From<NoulAnswer> for Answer
impl From<NoulAnswer> for Answer
Source§fn from(answer: NoulAnswer) -> Self
fn from(answer: NoulAnswer) -> Self
Converts to this type from the input type.
Source§impl From<ScoreAnswer> for Answer
impl From<ScoreAnswer> for Answer
Source§fn from(answer: ScoreAnswer) -> Self
fn from(answer: ScoreAnswer) -> Self
Converts to this type from the input type.
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