You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: der_writer.rs
    path of file: ./repos/phaser/phaser/vendor/ring/src/io
    
    the code of the file until where you have to start completion: // Copyright 2018 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appea
    
pub(crate) fn write_all(tag: Tag, write_value: &dyn Fn(&mut dyn Accumulator)) -> Box<[u8]> {
    let length = {
        let mut length = LengthMeasurement::zero();
        write_tlv(&mut length, tag, write_value);
        length
    };

    let mut output = Writer::with_capacity(length);
    write_tlv(&mut output, tag, write_value);

    output.into()
}