Macro convert_via_fromstr_and_display

Source
macro_rules! convert_via_fromstr_and_display {
    ($($(#[cfg $cfg:tt])?$t:ty),+ $(,)?) => { ... };
}
Expand description

§Generate AsXmlText and FromXmlText implementations

This macro generates an AsXmlText implementation which uses Display and an FromXmlText which uses FromStr for the types it is called on.

§Syntax

The macro accepts a comma-separated list of types. Optionally, each type can be preceded by a #[cfg(..)] attribute to make the implementations conditional on a feature.

§Example

struct Foo;

impl FromStr for Foo {
    /* ... */
}

impl Display for Foo {
    /* ... */
}

convert_via_fromstr_and_display!(
    Foo,
);