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: constant_expand.rs
    path of file: ./repos/LocustDB/src/engine/operators
    
    the code of the file until where you have to start completion: use crate::engine::*;

#[derive(Debug)]
pub struct ConstantExpand<T> {
    pub val: T,
    pub output: BufferRef<T>,

    pub current_index: usize,
    pub len: usize,
    pub batch_size: usize,
}

impl<'a, T: GenericIntVec<T>> VecOperator<'a> for ConstantExpand<T> {
    fn exec
    
    fn execute(&mut self, _: bool, scratchpad: &mut Scratchpad<'a>) -> Result<(), QueryError> {
        if self.current_index + self.batch_size > self.len {
            let mut output = scratchpad.get_mut(self.output);
            output.truncate(self.len - self.current_index);
        }
        self.current_index += self.batch_size;
        Ok(())
    }