private static void generateFromStrImplForEnum(
        final String enumRustName,
        final List<Token> messageBody,
        final Appendable writer) throws IOException
    {
        indent(writer, 0, "impl core::str::FromStr for %s {\n", enumRustName);
        indent(writer, 1, "type Err = ();\n\n");
        indent(writer, 1, "#[inline]\n");
        indent(writer, 1, "fn from_str(v: &str) -> core::result::Result<Self, Self::Err> {\n");
        indent(writer, 2, "match v {\n");
        for (final Token token : messageBody)
        {
            indent(writer, 3, "\"%1$s\" => Ok(Self::%1$s), \n", token.name());
        }
        // default => NullVal
        indent(writer, 3, "_ => Ok(Self::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