pub struct RadioGroupField {
pub id: Option<String>,
pub label: String,
pub options: Vec<RadioOption>,
pub default_value: Option<String>,
pub required: bool,
pub readonly: bool,
pub conditional_validation: Option<ConditionalValidation>,
}Expand description
Radio button group for single selection.
Fields§
§id: Option<String>Optional unique identifier.
label: StringField label displayed to the user.
options: Vec<RadioOption>Available options.
default_value: Option<String>Default selected value.
required: boolWhether a selection is required.
readonly: boolWhether the field is read-only.
conditional_validation: Option<ConditionalValidation>Conditional validation based on another field’s value.
Implementations§
Source§impl RadioGroupField
impl RadioGroupField
Sourcepub fn new(label: impl Into<String>, options: Vec<RadioOption>) -> Self
pub fn new(label: impl Into<String>, options: Vec<RadioOption>) -> Self
Create a new radio group field.
Sourcepub fn with_default(self, value: impl Into<String>) -> Self
pub fn with_default(self, value: impl Into<String>) -> Self
Set the default value.
Sourcepub fn with_conditional_validation(self, cv: ConditionalValidation) -> Self
pub fn with_conditional_validation(self, cv: ConditionalValidation) -> Self
Set conditional validation.
Trait Implementations§
Source§impl Clone for RadioGroupField
impl Clone for RadioGroupField
Source§fn clone(&self) -> RadioGroupField
fn clone(&self) -> RadioGroupField
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 moreSource§impl Debug for RadioGroupField
impl Debug for RadioGroupField
Source§impl<'de> Deserialize<'de> for RadioGroupField
impl<'de> Deserialize<'de> for RadioGroupField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RadioGroupField
impl PartialEq for RadioGroupField
Source§impl Serialize for RadioGroupField
impl Serialize for RadioGroupField
impl Eq for RadioGroupField
impl StructuralPartialEq for RadioGroupField
Auto Trait Implementations§
impl Freeze for RadioGroupField
impl RefUnwindSafe for RadioGroupField
impl Send for RadioGroupField
impl Sync for RadioGroupField
impl Unpin for RadioGroupField
impl UnsafeUnpin for RadioGroupField
impl UnwindSafe for RadioGroupField
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.