pub struct QuestionSet {
pub state: Option<Entry>,
pub questions: Vec<QuestionSpec>,
}Expand description
A parsed question-spec document: the questions map plus the optional shared state.
Insertion order is authoring order and is preserved end to end — it defines serialization order and argmax tie-breaking (D6). Question ids are unique (the authoring layer rejects duplicates with a positioned error).
Fields§
§state: Option<Entry>Optional shared state the questions refer to.
questions: Vec<QuestionSpec>The questions, in authoring order.
Implementations§
Source§impl QuestionSet
impl QuestionSet
Sourcepub fn question(&self, id: &str) -> Option<&QuestionSpec>
pub fn question(&self, id: &str) -> Option<&QuestionSpec>
Look up a question by id.
Trait Implementations§
Source§impl Clone for QuestionSet
impl Clone for QuestionSet
Source§fn clone(&self) -> QuestionSet
fn clone(&self) -> QuestionSet
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 QuestionSet
impl Debug for QuestionSet
Source§impl Default for QuestionSet
impl Default for QuestionSet
Source§fn default() -> QuestionSet
fn default() -> QuestionSet
Returns the “default value” for a type. Read more
Source§impl PartialEq for QuestionSet
impl PartialEq for QuestionSet
Source§fn eq(&self, other: &QuestionSet) -> bool
fn eq(&self, other: &QuestionSet) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for QuestionSet
Auto Trait Implementations§
impl Freeze for QuestionSet
impl RefUnwindSafe for QuestionSet
impl Send for QuestionSet
impl Sync for QuestionSet
impl Unpin for QuestionSet
impl UnsafeUnpin for QuestionSet
impl UnwindSafe for QuestionSet
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