Trait structform::ParseAndFormat[][src]

pub trait ParseAndFormat<T> {
    fn parse(value: &str) -> Result<T, ParseError>;
fn format(value: &T) -> String; }

Trait used to tie strongly typed models into form inputs. Libraries must define their own form inputs (although macros are provided to make this easy), and then implement ParseAndFormat for their input for all supported types. In other words, impl ParseAndFormat<MyType> for MyTextInput<MyType>.

Required methods

fn parse(value: &str) -> Result<T, ParseError>[src]

fn format(value: &T) -> String[src]

Loading content...

Implementors

Loading content...