static void generateDecoderFields(
        final StringBuilder sb,
        final List<Token> tokens,
        final int level)
    {
        Generators.forEachField(
            tokens,
            (fieldToken, typeToken) ->
            {
                try
                {
                    final String name = fieldToken.name();
                    final Encoding encoding = typeToken.encoding();

                    switch (typeToken.signal())
                    {
                        case ENCODING:
                            generatePrimitiveDecoder(sb, level, fieldToken, typeToken, name, encoding);
                            break;
                        case BEGIN_ENUM:
                            generateEnumDecoder(sb, level, fieldToken, typeToken, name);
                            break;
                        case BEGIN_SET:
                            generateBitSetDecoder(sb, level, typeToken, name);
                            break;
                        case BEGIN_COMPOSITE:
                            generateCompositeDecoder(sb, level, fieldToken, typeToken, name);
                            break;
                        default:
                            throw new UnsupportedOperationException("Unable to handle: " + typeToken);
                    }
                }
                catch (final IOException ex)
                {
                    throw new UncheckedIOException(ex);
                }
            });
    }
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