pub enum ResponseValue {
String(String),
Int(i64),
Float(f64),
Bool(bool),
ChosenVariant(usize),
ChosenVariants(Vec<usize>),
StringList(Vec<String>),
IntList(Vec<i64>),
FloatList(Vec<f64>),
}Expand description
A single response value collected from a survey.
This is the value stored in Responses for each answered question.
Variants§
String(String)
A string value (from Input, Multiline, or Masked questions).
Int(i64)
An integer value (from Int questions).
Float(f64)
A floating-point value (from Float questions).
Bool(bool)
A boolean value (from Confirm questions).
ChosenVariant(usize)
The index of the chosen variant in a OneOf question (enum selection).
ChosenVariants(Vec<usize>)
The indices of chosen variants in an AnyOf question (multi-select).
StringList(Vec<String>)
A list of string values (from List questions with String elements).
IntList(Vec<i64>)
A list of integer values (from List questions with Int elements).
FloatList(Vec<f64>)
A list of float values (from List questions with Float elements).
Implementations§
Source§impl ResponseValue
impl ResponseValue
Sourcepub fn as_chosen_variant(&self) -> Option<usize>
pub fn as_chosen_variant(&self) -> Option<usize>
Try to get this value as a chosen variant index.
Sourcepub fn as_chosen_variants(&self) -> Option<&[usize]>
pub fn as_chosen_variants(&self) -> Option<&[usize]>
Try to get this value as chosen variant indices.
Sourcepub fn as_string_list(&self) -> Option<&[String]>
pub fn as_string_list(&self) -> Option<&[String]>
Try to get this value as a string list.
Sourcepub fn as_int_list(&self) -> Option<&[i64]>
pub fn as_int_list(&self) -> Option<&[i64]>
Try to get this value as an integer list.
Sourcepub fn as_float_list(&self) -> Option<&[f64]>
pub fn as_float_list(&self) -> Option<&[f64]>
Try to get this value as a float list.
Trait Implementations§
Source§impl Clone for ResponseValue
impl Clone for ResponseValue
Source§fn clone(&self) -> ResponseValue
fn clone(&self) -> ResponseValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more