pub struct ApiResult {
    pub category: String,
    pub question_type: String,
    pub difficulty: String,
    pub question: String,
    pub correct_answer: String,
    pub incorrect_answers: Vec<String>,
}
Expand description

A struct representing a collection of Results of a ApiResponse.

Example Result:

{
  "category": "Entertainment: Music",
  "type": "multiple",
  "difficulty": "easy",
  "question": "The Red Hot Chili Pepper song &quot;Give It Away&quot; is from what album?",
  "correct_answer": "Blood Sugar Sex Magik",
  "incorrect_answers": [
     "One Hot Minute",
     "By the Way",
     "Stadium Arcadium"
  ]
}

If a type = “boolean”, incorrect_answers will only fill a single slot.

Fields

category: Stringquestion_type: Stringdifficulty: Stringquestion: Stringcorrect_answer: Stringincorrect_answers: Vec<String>

Trait Implementations

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.