[][src]Struct fui::fields::Field

pub struct Field<W: WidgetManager, T> { /* fields omitted */ }

Building block for Forms which stores data and Widget.

Methods

impl<W: WidgetManager> Field<W, bool>[src]

pub fn initial(self, value: bool) -> Self[src]

Sets initial value of field.

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]

pub fn initial<IS: Into<String>>(self, initial: IS) -> Self[src]

Sets initial value of field.

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_label(&self) -> &str[src]

Gets label of the field

fn get_help(&self) -> &str[src]

Gets help of the field

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_help(&self) -> &str[src]

Gets help of the field

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_help(&self) -> &str[src]

Gets help of the field

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_label(&self) -> &str[src]

Gets label of the field

fn get_help(&self) -> &str[src]

Gets help of the field

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]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<W, T> !Send for Field<W, T>

impl<W, T> !Sync for Field<W, T>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> With for T[src]

fn with<F>(self, f: F) -> Self where
    F: FnOnce(&mut Self), 
[src]

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]

Calls the given closure on self.

fn with_if<F>(self, condition: bool, f: F) -> Self where
    F: FnOnce(&mut Self), 
[src]

Calls the given closure if condition == true.

impl<T> Erased for T