pub struct Question {
pub id: String,
pub prompt: Option<String>,
pub description: Option<String>,
pub choices: Vec<QuestionChoice>,
pub multi: Option<bool>,
pub other: Option<OtherAnswer>,
pub required: Option<bool>,
}Expand description
A question of a questions node.
Fields§
§id: StringIts events’ item and its key in answers.
prompt: Option<String>The question.
description: Option<String>A line under the prompt.
choices: Vec<QuestionChoice>The choices.
multi: Option<bool>Several picks: the answer is a list of values.
other: Option<OtherAnswer>Takes a free-text answer from the input child keyed <id>.other.
required: Option<bool>No Skip; Next and Submit wait for its answer.
Implementations§
Source§impl Question
impl Question
Sourcepub fn new(id: impl Into<String>, prompt: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, prompt: impl Into<String>) -> Self
Question id asking prompt.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the line under the prompt.
Sourcepub fn choice(self, choice: impl Into<QuestionChoice>) -> Self
pub fn choice(self, choice: impl Into<QuestionChoice>) -> Self
Adds a choice.
Sourcepub fn other(self, other: impl Into<OtherAnswer>) -> Self
pub fn other(self, other: impl Into<OtherAnswer>) -> Self
Takes a free-text answer (true, or its placeholder).
Trait Implementations§
impl Eq for Question
impl StructuralPartialEq for Question
Auto Trait Implementations§
impl Freeze for Question
impl RefUnwindSafe for Question
impl Send for Question
impl Sync for Question
impl Unpin for Question
impl UnsafeUnpin for Question
impl UnwindSafe for Question
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.