pub struct FieldDefinition {Show 13 fields
pub name: String,
pub field_type: String,
pub required: bool,
pub required_if: Option<String>,
pub default: Option<Value>,
pub enum_values: Option<Vec<String>>,
pub min: Option<i64>,
pub max: Option<i64>,
pub min_items: Option<usize>,
pub max_items: Option<usize>,
pub array_item_type: Option<String>,
pub pattern: Option<Regex>,
pub description: Option<String>,
}Expand description
A field definition within a table.
Fields§
§name: StringField name (may be a path like “tcp_config.bind_address”)
field_type: StringField type (string, integer, boolean, float, array, table)
required: boolWhether this field is required
required_if: Option<String>Conditional requirement expression
default: Option<Value>Default value
enum_values: Option<Vec<String>>Allowed enum values
min: Option<i64>Minimum value (for numeric types)
max: Option<i64>Maximum value (for numeric types)
min_items: Option<usize>Minimum number of array items
max_items: Option<usize>Maximum number of array items
array_item_type: Option<String>Expected type of array items
pattern: Option<Regex>Pattern constraint for string values
description: Option<String>Field description
Implementations§
Source§impl FieldDefinition
impl FieldDefinition
Sourcepub fn is_conditionally_required(&self, table_data: &Value) -> bool
pub fn is_conditionally_required(&self, table_data: &Value) -> bool
Check if this field is conditionally required based on the given table data
Trait Implementations§
Source§impl Clone for FieldDefinition
impl Clone for FieldDefinition
Source§fn clone(&self) -> FieldDefinition
fn clone(&self) -> FieldDefinition
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 moreAuto Trait Implementations§
impl Freeze for FieldDefinition
impl RefUnwindSafe for FieldDefinition
impl Send for FieldDefinition
impl Sync for FieldDefinition
impl Unpin for FieldDefinition
impl UnwindSafe for FieldDefinition
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