pub struct Choice {
pub instructions: Option<Value>,
pub criteria: ChoiceCriteria,
}Expand description
A question that selects among named alternatives.
Fields§
§instructions: Option<Value>Optional question text or structured JSON.
criteria: ChoiceCriteriaNamed alternatives and their descriptions.
Implementations§
Source§impl Choice
impl Choice
Sourcepub fn new<K, V>(criteria: impl IntoIterator<Item = (K, V)>) -> Self
pub fn new<K, V>(criteria: impl IntoIterator<Item = (K, V)>) -> Self
Create a choice from label-description pairs, such as [("yes", "Accept"), ("no", "Reject")].
Sourcepub fn instructions(self, instructions: impl Into<Value>) -> Self
pub fn instructions(self, instructions: impl Into<Value>) -> Self
Set instructions, preserving an explicitly supplied JSON null.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Choice
impl RefUnwindSafe for Choice
impl Send for Choice
impl Sync for Choice
impl Unpin for Choice
impl UnsafeUnpin for Choice
impl UnwindSafe for Choice
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