Expand description
Core types for the derive-survey crate.
This crate provides the foundational types for defining surveys:
SurveyDefinition- The top-level survey structureQuestionandQuestionKind- Individual questions and their typesResponsesandResponsePath- Collected data and path-based keysSurveyandSurveyBackendtraits - For implementing surveys and backends
Structs§
- AllOf
Question - Configuration for an AllOf question (a group of questions that are all answered).
- AnyOf
Question - Configuration for an AnyOf question (multi-select with potential follow-up questions).
- Confirm
Question - Configuration for a yes/no confirmation question.
- Float
Question - Configuration for a floating-point input question.
- Input
Question - Configuration for a text input question.
- IntQuestion
- Configuration for an integer input question.
- List
Question - Configuration for a list input question (Vec
). - Masked
Question - Configuration for a password/masked input question.
- Multiline
Question - Configuration for a multi-line text editor question.
- OneOf
Question - Configuration for a OneOf question (choose exactly one variant).
- Question
- A single question in a survey.
- Response
Path - A path to a response value, e.g.,
"address.street". - Responses
- Collected responses from a survey.
- Survey
Definition - The top-level structure containing all questions and metadata for a survey.
- Variant
- A variant in a OneOf question (enum variant).
Enums§
- Default
Value - Default value for a question.
- List
Element Kind - The type of elements in a list question.
- Question
Kind - The kind of question, determining input type and structure.
- Response
Error - Error type for response access operations.
- Response
Value - A single response value collected from a survey.
- Survey
Error - Error type for survey operations.
Constants§
- SELECTED_
VARIANTS_ KEY - The key suffix used to store selected variant indices for AnyOf questions. For a field “features”, the selections are stored at “features.selected_variants”.
- SELECTED_
VARIANT_ KEY - The key suffix used to store the selected enum variant index in responses. For a field “method”, the selection is stored at “method.selected_variant”.
Traits§
- Survey
- Trait for types that can be collected via a survey.
- Survey
Backend - Trait for backend implementations that collect survey responses.