pub struct Question {
pub header: String,
pub question: String,
pub kind: QuestionKind,
pub options: Vec<QuestionOption>,
pub memory_key: Option<String>,
}Expand description
One question in a batch. Stage 1: a labeled choice, single- or multi-select.
camelCase so the model’s multiSelect field deserializes directly.
Fields§
§header: StringShort chip label shown above the question (e.g. “Database”). Kept short (~12 cells) by the render layer.
question: StringThe question text itself.
kind: QuestionKindHow the question is answered — choice kinds (Select/MultiSelect/
Rank) use options; input kinds (Text/Number/Date/Path) use a
single typed value.
options: Vec<QuestionOption>The selectable options (choice kinds only), in display order. A recommended option is listed first and flagged. Empty for input kinds.
memory_key: Option<String>Stable key for remembering the user’s answer across sessions. When set and the user opts to remember, a later question with the same key auto-answers without prompting.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Question
impl<'de> Deserialize<'de> for Question
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 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