pub struct QuestionSpec {
pub id: String,
pub kind: QuestionKind,
pub instructions: Option<Entry>,
pub body: QuestionBody,
}Expand description
One runtime-declared question.
Fields§
§id: StringCaller-chosen id. Opaque on the wire and never serialized to the model. For
Arrow emission it must additionally be identifier-safe (see
crate::arrow::DecisionSchema).
kind: QuestionKindThe primitive type.
instructions: Option<Entry>Optional instructions (D4): the question text in practice.
body: QuestionBodyThe per-kind payload.
Implementations§
Source§impl QuestionSpec
impl QuestionSpec
Sourcepub fn cardinality(&self) -> usize
pub fn cardinality(&self) -> usize
Number of labels in this question’s distribution: 2 for noul
([false, true]), option count for choice, level count for score.
Trait Implementations§
Source§impl Clone for QuestionSpec
impl Clone for QuestionSpec
Source§fn clone(&self) -> QuestionSpec
fn clone(&self) -> QuestionSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuestionSpec
impl Debug for QuestionSpec
Source§impl PartialEq for QuestionSpec
impl PartialEq for QuestionSpec
Source§fn eq(&self, other: &QuestionSpec) -> bool
fn eq(&self, other: &QuestionSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for QuestionSpec
Auto Trait Implementations§
impl Freeze for QuestionSpec
impl RefUnwindSafe for QuestionSpec
impl Send for QuestionSpec
impl Sync for QuestionSpec
impl Unpin for QuestionSpec
impl UnsafeUnpin for QuestionSpec
impl UnwindSafe for QuestionSpec
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