Struct fiberplane_models::providers::TextField
source · #[non_exhaustive]pub struct TextField {
pub label: String,
pub multiline: bool,
pub multiple: bool,
pub name: String,
pub placeholder: String,
pub prerequisites: Vec<String>,
pub required: bool,
pub supports_suggestions: bool,
}Expand description
Defines a free-form text entry field.
This is commonly used for filter text and query entry.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.label: StringSuggested label to display along the form field.
multiline: boolWhether multi-line input is useful for this provider.
multiple: boolWhether multiple values may be inserted.
name: StringName of the field as it will be included in the encoded query or config object.
placeholder: StringSuggested placeholder to display when there is no value.
prerequisites: Vec<String>An optional list of fields that should be filled in before allowing the user to fill in this field. This forces a certain ordering in the data entry, which enables richer auto-suggestions, since the filled in prerequisite fields can provide additional context.
required: boolWhether a value is required.
supports_suggestions: boolWhether the provider supports auto-suggestions for this field.
Implementations§
source§impl TextField
impl TextField
pub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
pub fn with_prerequisites(self, prerequisites: impl Into<Vec<String>>) -> Self
sourcepub fn with_suggestions(self) -> Self
pub fn with_suggestions(self) -> Self
Marks the field as supporting auto-suggestions.