[−][src]Struct fui::fields::Field
Building block for Form
s which stores data
and Widget
.
Methods
impl<W: WidgetManager> Field<W, bool>
[src]
impl<W: WidgetManager> Field<W, Vec<String>>
[src]
pub fn initial<U: Deref<Target = str>>(self, initial: Vec<U>) -> Self
[src]
Sets initial value
of field
.
impl<W: WidgetManager> Field<W, String>
[src]
impl<W: WidgetManager, T> Field<W, T>
[src]
pub fn new<IS: Into<String>>(label: IS, widget_manager: W, initial: T) -> Self
[src]
Creates a new Field
with given label
, widget_manager
, initial
.
label
should match NOTE from Fui::action
pub fn help<IS: Into<String>>(self, msg: IS) -> Self
[src]
Sets help
message for field
.
pub fn validator<V: Validator + 'static>(self, validator: V) -> Self
[src]
Append validator
.
pub fn is_required(&self) -> bool
[src]
Checks if Field is required
Trait Implementations
impl FormField for Field<AutocompleteManager, String>
[src]
fn get_widget_manager(&self) -> &dyn WidgetManager
[src]
fn validate(&self, data: &str) -> Result<Value, FieldErrors>
[src]
fn get_label(&self) -> &str
[src]
Gets label of the field
fn get_help(&self) -> &str
[src]
Gets help of the field
fn get_initial(&self) -> String
[src]
fn clap_arg(&self) -> Arg
[src]
fn clap_args2str(&self, args: &ArgMatches) -> String
[src]
fn is_required(&self) -> bool
[src]
fn build_widget(&self) -> ViewBox
[src]
Builds widget
representing this field
.
fn set_error(&self, viewbox: &mut ViewBox, error: &str)
[src]
Sets error
on widget.
impl FormField for Field<CheckboxManager, bool>
[src]
fn get_widget_manager(&self) -> &dyn WidgetManager
[src]
fn get_label(&self) -> &str
[src]
fn get_help(&self) -> &str
[src]
Gets help of the field
fn get_initial(&self) -> String
[src]
fn validate(&self, data: &str) -> Result<Value, FieldErrors>
[src]
fn clap_arg(&self) -> Arg
[src]
fn clap_args2str(&self, args: &ArgMatches) -> String
[src]
fn is_required(&self) -> bool
[src]
fn build_widget(&self) -> ViewBox
[src]
Builds widget
representing this field
.
fn set_error(&self, viewbox: &mut ViewBox, error: &str)
[src]
Sets error
on widget.
impl FormField for Field<MultiselectManager, Vec<String>>
[src]
fn get_widget_manager(&self) -> &dyn WidgetManager
[src]
fn validate(&self, data: &str) -> Result<Value, FieldErrors>
[src]
fn get_label(&self) -> &str
[src]
fn get_help(&self) -> &str
[src]
Gets help of the field
fn get_initial(&self) -> String
[src]
fn clap_arg(&self) -> Arg
[src]
fn clap_args2str(&self, args: &ArgMatches) -> String
[src]
fn is_required(&self) -> bool
[src]
fn build_widget(&self) -> ViewBox
[src]
Builds widget
representing this field
.
fn set_error(&self, viewbox: &mut ViewBox, error: &str)
[src]
Sets error
on widget.
impl FormField for Field<TextManager, String>
[src]
fn get_widget_manager(&self) -> &dyn WidgetManager
[src]
fn validate(&self, data: &str) -> Result<Value, FieldErrors>
[src]
fn get_label(&self) -> &str
[src]
Gets label of the field
fn get_help(&self) -> &str
[src]
Gets help of the field
fn get_initial(&self) -> String
[src]
fn clap_arg(&self) -> Arg
[src]
fn clap_args2str(&self, args: &ArgMatches) -> String
[src]
fn is_required(&self) -> bool
[src]
fn build_widget(&self) -> ViewBox
[src]
Builds widget
representing this field
.
fn set_error(&self, viewbox: &mut ViewBox, error: &str)
[src]
Sets error
on widget.
impl<W: Clone + WidgetManager, T: Clone> Clone for Field<W, T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> With for T
[src]
fn with<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
Calls the given closure on self
.
fn try_with<E, F>(self, f: F) -> Result<Self, E> where
F: FnOnce(&mut Self) -> Result<(), E>,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
Calls the given closure on self
.
fn with_if<F>(self, condition: bool, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
Calls the given closure if condition == true
.