macro_rules! old_new {
    ($attr_wrapper:ident, $old:ty, $new:ty) => { ... };
}
Expand description

The old_new macro desognates three structures:

  1. The enum wrapper name.
  2. The old type name.
  3. The new type name.

The macro creates a new enumeration with two variants: ::Old(...) and ::New(...) The old and new variants contain the old and new type, respectively. It also implements From<$old> and From<$new> for the new wrapper type. This is to facilitate the deprecation of extremely similar structures that have only a few differences, and to be able to warn the user of the library when the ::Old(...) variant has been used.