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: limit.rs
    path of file: ./repos/angle-grinder/src/operator
    
    the code of the file until where you have to start completion: use crate::data::Record;
use crate::operator::{EvalError, OperatorBuilder, UnaryPreAggOperator};
use std::collections::VecDeque;
use std::iter;

/// The state for a limit operator
pub enum Limit {
    Head {
        /// The current index into the input stream.
        index: u64,
        /// The number of rows to pass through before aborting.
        limit: u64,
    },
    Tail {
        /// A circular queue to keep track of the tail of the in
    
    fn process_mut(&mut self, rec: Record) -> Result<Option<Record>, EvalError> {
        match self {
            Limit::Head {
                ref mut index,
                limit,
            } => {
                (*index) += 1;

                if index <= limit {
                    Ok(Some(rec))
                } else {
                    Ok(None)
                }
            }
            Limit::Tail {
                ref mut queue,
                limit,
            } => {
                if queue.len() == *limit {
                    queue.pop_front();
                }
                queue.push_back(rec);

                Ok(None)
            }
        }
    }