Macro structform::impl_text_input_with_stringops[][src]

macro_rules! impl_text_input_with_stringops {
    ($text_input: ident, $type_name: literal, $type: ty) => { ... };
    ($text_input: ident, $type: ty) => { ... };
    ($text_input: ident, $handle_error: expr, $type: ty) => { ... };
}

Implements ParseAndFormat<$type> for $text_input<$type>, and also implements ParseAndFormat<Option<$type>>> for $text_input<Option<$type>>.

This will parse by trimming the string input and then calling str::parse. If the input string is empty after trimming, then parse will return a ParseError::Required for the ParseAndFormat<$type> case, and return None for the ParseAndFormat<Option<$type>> case.

Formatting is done using std::string::ToString.