Macro biodivine_sketchbook::generate_property_enums

source ยท
macro_rules! generate_property_enums {
    (
        $(#[$doc_orig:meta])*
        $original_enum:ident,
        $(#[$doc_simplified:meta])*
        $simple_enum:ident, {
            $($variant:ident($inner:ty)),*
        }
    ) => { ... };
}
Expand description

Generate two enums for property variants - one where each variant contains inner data, and the other (with completely same variants) without the inner data.

Also generates From trait for converting the complex one into the simpler one.

This is used for static and dynamic properties. In this case, one of the datatypes will carry the whole property data, while the other will be used in cases when inner data are not needed.