private static void generatePrimitiveArrayZeroPaddedEncoder(
        final StringBuilder sb,
        final int level,
        final Token typeToken,
        final String name) throws IOException
    {
        final Encoding encoding = typeToken.encoding();
        final PrimitiveType primitiveType = encoding.primitiveType();
        final String rustPrimitiveType = rustTypeName(primitiveType);
        final int arrayLength = typeToken.arrayLength();

        indent(sb, level, "/// primitive array field '%s' with zero padding\n", name);
        generateRustDoc(sb, level, typeToken, encoding);
        indent(sb, level, "#[inline]\n");
        indent(sb, level, "pub fn %s_zero_padded(&mut self, value: &[%s]) {\n",
            formatFunctionName(name), rustPrimitiveType);

        indent(sb, level + 1, "let iter = value.iter().copied().chain(std::iter::repeat(0_%s)).take(%d);\n",
            rustPrimitiveType, arrayLength);

        indent(sb, level + 1, "self.%s_from_iter(iter);\n", formatFunctionName(name));
        indent(sb, level, "}\n\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