Skip to main content

enum_field_match

Macro enum_field_match 

Source
macro_rules! enum_field_match {
    ($name:ident, $a0:ident, $a1:ident) => { ... };
    ($name:ident, $a0:ident, $a1:ident, $d:tt) => { ... };
    ($name:ident, [$a0:ident, $a1:ident], $b0:ident) => { ... };
    ($name:ident, [$a0:ident, $a1:ident], $b0:ident, $d:tt) => { ... };
    ($name:ident, [$a0:ident, $a1:ident], [$b0:ident,$b1:ident], $coproduct:ty) => { ... };
    ($name:ident, [$a0:ident, $a1:ident], [$b0:ident,$b1:ident], $coproduct:ty, $d:tt) => { ... };
    ($name:ident, $A:ty {$a0:ident, $a1:ident}, $B:ty {$b0:ident,$b1:ident}) => { ... };
    ($name:ident, $A:ty {$a0:ident, $a1:ident}, $B:ty {$b0:ident,$b1:ident}, $d:tt) => { ... };
}
Expand description

Generates heterogeneous field accessors by enum variant values. $name - name of the generated macro

Cases: $a - access a field by one enum single variant value

[a<1-3>] - comma-separated variants of the first enum

[a<1-3>] - comma-separated variants of the first enum [b<1-3>] - comma-separated variants of the second enum