pub struct SurveyDefinition {
pub prelude: Option<String>,
pub questions: Vec<Question>,
pub epilogue: Option<String>,
}Expand description
The top-level structure containing all questions and metadata for a survey.
A survey is a structured collection of questions. It’s presentation-agnostic — it can be rendered as a sequential interview, a fill-in form, or used to generate documents.
Fields§
§prelude: Option<String>Optional message shown before the survey starts.
questions: Vec<Question>All questions in the survey (may contain nested AllOf/OneOf/AnyOf).
epilogue: Option<String>Optional message shown after the survey completes.
Implementations§
Source§impl SurveyDefinition
impl SurveyDefinition
Sourcepub fn new(questions: Vec<Question>) -> Self
pub fn new(questions: Vec<Question>) -> Self
Create a new survey definition with the given questions.
Sourcepub fn with_prelude(self, prelude: impl Into<String>) -> Self
pub fn with_prelude(self, prelude: impl Into<String>) -> Self
Set the prelude message.
Sourcepub fn with_epilogue(self, epilogue: impl Into<String>) -> Self
pub fn with_epilogue(self, epilogue: impl Into<String>) -> Self
Set the epilogue message.
Sourcepub fn questions_mut(&mut self) -> &mut Vec<Question>
pub fn questions_mut(&mut self) -> &mut Vec<Question>
Get a mutable reference to the questions.
Trait Implementations§
Source§impl Clone for SurveyDefinition
impl Clone for SurveyDefinition
Source§fn clone(&self) -> SurveyDefinition
fn clone(&self) -> SurveyDefinition
Returns a duplicate of the value. Read more
1.0.0 · 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 SurveyDefinition
impl Debug for SurveyDefinition
Auto Trait Implementations§
impl Freeze for SurveyDefinition
impl RefUnwindSafe for SurveyDefinition
impl Send for SurveyDefinition
impl Sync for SurveyDefinition
impl Unpin for SurveyDefinition
impl UnwindSafe for SurveyDefinition
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