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: wavetable_generator.rs
    path of file: ./repos/UnicornConsole/unicorn/src/audio/instruments/wavetable
    
    the code of the file until where you have to start completion: use std::f32::consts::TAU;

use audio::instruments::wavetable::wavetable_waveform::WavetableWaveform;

use super::{WavetableBitDepth};

/// Use to generate wavetables based on 
    
    pub fn generate(&self) -> Box<[WavetableBitDepth]> {
        (0..self.size)
            .map(|index| {
                let value = (TAU * index as f32) / self.size as f32;
                let value = self.waveform.func(value);
                let value = value * WavetableBitDepth::MAX as f32;
                value as WavetableBitDepth
            })
            .collect::<Vec<WavetableBitDepth>>()
            .into_boxed_slice()
    }