private static void generateEnums(
        final Ir ir,
        final RustOutputManager outputManager) throws IOException
    {
        final Set<String> enumTypeNames = new HashSet<>();
        for (final List<Token> tokens : ir.types())
        {
            if (tokens.isEmpty())
            {
                continue;
            }

            final Token beginToken = tokens.get(0);
            if (beginToken.signal() != BEGIN_ENUM)
            {
                continue;
            }

            final String typeName = beginToken.applicableTypeName();
            if (!enumTypeNames.add(typeName))
            {
                continue;
            }

            try (Writer out = outputManager.createOutput(typeName))
            {
                generateEnum(tokens, out);
            }
        }
    }
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