Crate elicitor_types

Crate elicitor_types 

Source
Expand description

Core types for the derive-survey crate.

This crate provides the foundational types for defining surveys:

  • SurveyDefinition - The top-level survey structure
  • Question and QuestionKind - Individual questions and their types
  • Responses and ResponsePath - Collected data and path-based keys
  • Survey and SurveyBackend traits - For implementing surveys and backends

Structs§

AllOfQuestion
Configuration for an AllOf question (a group of questions that are all answered).
AnyOfQuestion
Configuration for an AnyOf question (multi-select with potential follow-up questions).
ConfirmQuestion
Configuration for a yes/no confirmation question.
FloatQuestion
Configuration for a floating-point input question.
InputQuestion
Configuration for a text input question.
IntQuestion
Configuration for an integer input question.
ListQuestion
Configuration for a list input question (Vec).
MaskedQuestion
Configuration for a password/masked input question.
MultilineQuestion
Configuration for a multi-line text editor question.
OneOfQuestion
Configuration for a OneOf question (choose exactly one variant).
Question
A single question in a survey.
ResponsePath
A path to a response value, e.g., "address.street".
Responses
Collected responses from a survey.
SurveyDefinition
The top-level structure containing all questions and metadata for a survey.
Variant
A variant in a OneOf question (enum variant).

Enums§

DefaultValue
Default value for a question.
ListElementKind
The type of elements in a list question.
QuestionKind
The kind of question, determining input type and structure.
ResponseError
Error type for response access operations.
ResponseValue
A single response value collected from a survey.
SurveyError
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.
SurveyBackend
Trait for backend implementations that collect survey responses.