private static void generateDisplayImplForEnum(
        final String enumRustName,
        final String primitiveType,
        final List<Token> messageBody,
        final Appendable writer) throws IOException
    {
        indent(writer, 0, "impl core::fmt::Display for %s {\n", enumRustName);
        indent(writer, 1, "#[inline]\n");
        indent(writer, 1, "fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {\n");
        indent(writer, 2, "match self {\n");
        for (final Token token : messageBody)
        {
            indent(writer, 3, "Self::%1$s => write!(f, \"%1$s\"), \n", token.name());
        }
        // default => Err
        indent(writer, 3, "Self::NullVal => write!(f, \"NullVal\"),\n");
        indent(writer, 2, "}\n");
        indent(writer, 1, "}\n");
        indent(writer, 0, "}\n");
    }
Create a new Rust language {@link CodeGenerator}.

@param ir            for the messages and types.
@param crateVersion  for the generated crate.
@param outputManager for generating the codecs to.
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/RustGenerator.java