pub struct RadioSelectElement {
pub id: String,
pub label: String,
pub options: Vec<SelectOption>,
pub initial_option: Option<String>,
}Expand description
A radio-button select group.
Fields§
§id: StringUnique identifier for the radio group (used in submission payloads).
label: StringLabel displayed above the radio group.
options: Vec<SelectOption>Available options.
initial_option: Option<String>Value of the initially selected option.
Implementations§
Source§impl RadioSelectElement
impl RadioSelectElement
Sourcepub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
Create a new radio select group with the given identifier and label.
Sourcepub fn option(self, option: SelectOption) -> Self
pub fn option(self, option: SelectOption) -> Self
Append an option.
Sourcepub fn initial_option(self, value: impl Into<String>) -> Self
pub fn initial_option(self, value: impl Into<String>) -> Self
Set the initially selected option by value.
Trait Implementations§
Source§impl Clone for RadioSelectElement
impl Clone for RadioSelectElement
Source§fn clone(&self) -> RadioSelectElement
fn clone(&self) -> RadioSelectElement
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 RadioSelectElement
impl Debug for RadioSelectElement
Source§impl<'de> Deserialize<'de> for RadioSelectElement
impl<'de> Deserialize<'de> for RadioSelectElement
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
Auto Trait Implementations§
impl Freeze for RadioSelectElement
impl RefUnwindSafe for RadioSelectElement
impl Send for RadioSelectElement
impl Sync for RadioSelectElement
impl Unpin for RadioSelectElement
impl UnsafeUnpin for RadioSelectElement
impl UnwindSafe for RadioSelectElement
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