[][src]Macro swc_neuron::structure_mapping

macro_rules! structure_mapping {
    ( $id:ident $(, $val:literal = $name:ident )* $(,)?) => { ... };
    ( $id:ident $(, $val:literal = $name:ident )*, $othername:ident $(,)?) => { ... };
}

Macro for creating a public enum implementing StructureIdentifier.

The first argument is the enum's identifier. Subsequent arguments are given in the form value = variant: that is, a signed integer literal, then an equals sign, then the identifier of the enum variant that literal represents. There is an optional final argument which is the identifier of a variant which catches all other values, and stores the value originally given to it.

If the final argument is given, the enum implements From: otherwise, it only implements TryFrom, returning an error which contains the offending integer.