pub struct MultipleChoiceField {
pub name: String,
pub label: Option<String>,
pub required: bool,
pub help_text: Option<String>,
pub widget: Widget,
pub initial: Option<Value>,
pub choices: Vec<(String, String)>,
}Expand description
MultipleChoiceField for selecting multiple choices
Fields§
§name: StringThe field name used as the form data key.
label: Option<String>Optional human-readable label for display.
required: boolWhether at least one selection is required.
help_text: Option<String>Optional help text displayed alongside the field.
widget: WidgetThe widget type used for rendering this field.
initial: Option<Value>Optional initial (default) value for the field.
choices: Vec<(String, String)>Available choices as (value, display_label) pairs.
Implementations§
Trait Implementations§
Source§impl Clone for MultipleChoiceField
impl Clone for MultipleChoiceField
Source§fn clone(&self) -> MultipleChoiceField
fn clone(&self) -> MultipleChoiceField
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MultipleChoiceField
impl Debug for MultipleChoiceField
Source§impl FormField for MultipleChoiceField
impl FormField for MultipleChoiceField
Source§fn initial(&self) -> Option<&Value>
fn initial(&self) -> Option<&Value>
Returns the initial (default) value for this field, if any.
Source§fn clean(&self, value: Option<&Value>) -> FieldResult<Value>
fn clean(&self, value: Option<&Value>) -> FieldResult<Value>
Validates and cleans the submitted value, returning the cleaned result.
Auto Trait Implementations§
impl Freeze for MultipleChoiceField
impl RefUnwindSafe for MultipleChoiceField
impl Send for MultipleChoiceField
impl Sync for MultipleChoiceField
impl Unpin for MultipleChoiceField
impl UnsafeUnpin for MultipleChoiceField
impl UnwindSafe for MultipleChoiceField
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