Struct opentdb::api_response::ApiResult
source · 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 "Give It Away" 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: String
question_type: String
difficulty: String
question: String
correct_answer: String
incorrect_answers: Vec<String>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ApiResult
impl<'de> Deserialize<'de> for ApiResult
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for ApiResult
impl Send for ApiResult
impl Sync for ApiResult
impl Unpin for ApiResult
impl UnwindSafe for ApiResult
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more