pub enum DefaultValue {
None,
Suggested(ResponseValue),
Assumed(ResponseValue),
}Expand description
Default value for a question.
Controls whether a question has a pre-filled value and whether it’s shown to the user.
Variants§
None
No default value - user must provide input.
Suggested(ResponseValue)
A suggested value that the user can accept or modify. The question is shown with this value pre-filled.
Assumed(ResponseValue)
An assumed value that skips the question entirely. The question is not shown; this value is used directly.
Implementations§
Source§impl DefaultValue
impl DefaultValue
Sourcepub fn is_assumed(&self) -> bool
pub fn is_assumed(&self) -> bool
Check if this is an assumed value (question should be skipped).
Sourcepub fn is_suggested(&self) -> bool
pub fn is_suggested(&self) -> bool
Check if this is a suggested value.
Sourcepub fn value(&self) -> Option<&ResponseValue>
pub fn value(&self) -> Option<&ResponseValue>
Get the inner value if this is Suggested or Assumed.
Trait Implementations§
Source§impl Clone for DefaultValue
impl Clone for DefaultValue
Source§fn clone(&self) -> DefaultValue
fn clone(&self) -> DefaultValue
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 DefaultValue
impl Debug for DefaultValue
Source§impl Default for DefaultValue
impl Default for DefaultValue
Source§fn default() -> DefaultValue
fn default() -> DefaultValue
Returns the “default value” for a type. Read more
Source§impl PartialEq for DefaultValue
impl PartialEq for DefaultValue
impl StructuralPartialEq for DefaultValue
Auto Trait Implementations§
impl Freeze for DefaultValue
impl RefUnwindSafe for DefaultValue
impl Send for DefaultValue
impl Sync for DefaultValue
impl Unpin for DefaultValue
impl UnwindSafe for DefaultValue
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