Trait FormWith

Source
pub trait FormWith<C> {
    // Required method
    fn new_form_with_(
        context: &C,
        field: &str,
        from: Option<&Self>,
        depth: usize,
    ) -> (FormElements, Box<dyn FormState<Self>>);

    // Provided method
    fn new_form_with(
        context: &C,
        field: &str,
        from: Option<&Self>,
    ) -> (FormElements, 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_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Provided Methods§

Source

fn new_form_with( context: &C, field: &str, from: Option<&Self>, ) -> (FormElements, 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C> FormWith<C> for bool

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for f32

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for f64

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for i8

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for i16

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for i32

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for i64

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for u8

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for u16

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for u32

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for u64

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

impl<C> FormWith<C> for String

Source§

fn new_form_with_( _context: &C, field: &str, from: Option<&Self>, _depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Source§

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

Source§

fn new_form_with_( context: &C, field: &str, from: Option<&Self>, depth: usize, ) -> (FormElements, Box<dyn FormState<Self>>)

Implementors§