pub struct Question {
pub kind: QuestionKind,
pub instructions: String,
pub criteria: Criteria,
}Expand description
A question after validation, equivalent to upstream’s internal
{"t": ..., "ins": ..., "crit": ...} triple.
Fields§
§kind: QuestionKind§instructions: String§criteria: CriteriaImplementations§
Source§impl Question
impl Question
Sourcepub fn from_value(value: &Value) -> Result<Self>
pub fn from_value(value: &Value) -> Result<Self>
Validate one question definition, mirroring Agent._to_internal.
Sourcepub fn render_options(&self) -> Vec<String>
pub fn render_options(&self) -> Vec<String>
Option texts in label-index order. Noul is always [false, true].
Sourcepub fn choice_labels(&self) -> Option<Vec<String>>
pub fn choice_labels(&self) -> Option<Vec<String>>
Labels for a choice question, in order.
Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more