pub trait FormWith<C> {
    // Required method
    fn new_form(
        context: &C,
        field: &str,
        from: Option<&Self>
    ) -> Box<dyn FormState<Self>>;
}
Expand description

Like Form but allows passing in additional context, for custom elements that need it. FormWith<()> is generated by the Form derive macro.

Required Methods§

source

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

Generates a form state manager to produce form elements and parse the entered values.

  • context - any additional data to be used when generating form states and elements. This is forwarded to all nested new_form calls.

See Form for the other fields.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<C> FormWith<C> for bool

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for f32

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for f64

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for i8

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for i16

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for i32

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for i64

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for u8

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for u16

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for u32

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for u64

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C> FormWith<C> for String

source§

fn new_form( _context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static + Clone, T: FormWith<C> + 'static> FormWith<C> for Vec<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static, T: FormWith<C> + 'static> FormWith<C> for Option<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static, T: FormWith<C> + 'static> FormWith<C> for Rc<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static, T: FormWith<C> + 'static> FormWith<C> for Arc<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static, T: FormWith<C> + 'static> FormWith<C> for RefCell<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static, T: FormWith<C> + 'static> FormWith<C> for Mutex<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

source§

impl<C: 'static, T: FormWith<C> + Copy + Clone + 'static> FormWith<C> for Cell<T>

source§

fn new_form( context: &C, field: &str, from: Option<&Self> ) -> Box<dyn FormState<Self>>

Implementors§