pub struct Question { /* private fields */ }Expand description
A single question in a survey.
Implementations§
Source§impl Question
impl Question
Sourcepub fn new(
path: impl Into<ResponsePath>,
ask: impl Into<String>,
kind: QuestionKind,
) -> Self
pub fn new( path: impl Into<ResponsePath>, ask: impl Into<String>, kind: QuestionKind, ) -> Self
Create a new question.
Sourcepub fn path(&self) -> &ResponsePath
pub fn path(&self) -> &ResponsePath
Get the response path for this question.
Sourcepub fn kind(&self) -> &QuestionKind
pub fn kind(&self) -> &QuestionKind
Get the question kind.
Sourcepub fn kind_mut(&mut self) -> &mut QuestionKind
pub fn kind_mut(&mut self) -> &mut QuestionKind
Get a mutable reference to the question kind.
Sourcepub fn default(&self) -> &DefaultValue
pub fn default(&self) -> &DefaultValue
Get the default value.
Sourcepub fn set_suggestion(&mut self, value: impl Into<ResponseValue>)
pub fn set_suggestion(&mut self, value: impl Into<ResponseValue>)
Set a suggested default value (user can modify).
Sourcepub fn set_assumption(&mut self, value: impl Into<ResponseValue>)
pub fn set_assumption(&mut self, value: impl Into<ResponseValue>)
Set an assumed value (question is skipped entirely).
Sourcepub fn clear_default(&mut self)
pub fn clear_default(&mut self)
Clear any default value.
Sourcepub fn is_assumed(&self) -> bool
pub fn is_assumed(&self) -> bool
Check if this question should be skipped (has an assumed value).
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 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