Skip to main content

dispatch_enum

Macro dispatch_enum 

Source
macro_rules! dispatch_enum {
    (
        $(#[$meta:meta])*
        $vis:vis enum $name:ident {
            $(
                #[cfg(feature = $feat:literal)]
                $variant:ident => $module:path,
            )+
        }
        decode($decode_fn:ident);
        encode($encode_fn:ident -> $encode_ret:ty);
    ) => { ... };
}
Expand description

Generates a dispatch enum with one variant per enabled draft feature.

Each variant wraps the draft-specific type and delegates encode/decode to the appropriate draft module.