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: writer.rs
    path of file: ./repos/cnosdb/tskv/src/tsm2
    
    the code of the file until where you have to start completion: use std::cmp::{max, min};
use std::collections::{BTreeMap, HashMap};
use std::io::IoSlice;
use std::path::{Path, PathBuf};
use std::sync::Arc;

use minivec::MiniVec;
use models::codec::Encoding;
use models::field_value::FieldVal;
use models::predicate::domain::TimeRange;
use models::schema::{ColumnType, TableColumn, TskvTableSchemaRef};
use models::{SeriesId, SeriesKey, ValueType};
use snafu::ResultExt;
use utils::bitset::BitSet;

    
    pub async fn write_chunk_group_specs(&mut self, series: SeriesMeta) -> Result<()> {
        let chunk_group_specs_offset = self.writer.pos();
        let buf = self.chunk_group_specs.serialize()?;
        let chunk_group_specs_size = self.writer.write(&buf).await?;
        self.size += chunk_group_specs_size;
        let time_range = self.chunk_group_specs.time_range();
        let footer = Footer {
            version: 2_u8,
            time_range,
            table: TableMeta::new(chunk_group_specs_offset, chunk_group_specs_size),
            series,
        };
        self.footer = footer;
        Ok(())
    }