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: column.rs
    path of file: ./repos/tikv/components/tidb_query_datatype/src/codec/chunk
    
    the code of the file until where you have to start completion: // Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.

use codec::{
    buffer::{BufferReader, BufferWriter},
    number::{NumberDecoder, NumberEncoder},
};
use tikv_util::buffer_vec::BufferVec;
use tipb::FieldType;

use super::{Error, Result};
use crate::{
    codec::{
        data_type::{ChunkRef, VectorValue},
        datum,
        datum_codec::DatumPayloadDecoder,
        mysql::{
            decimal::{
                Decimal, DecimalDatumPayloadChunkEncoder, DecimalDecoder, DecimalEncoder,
                DECIMAL_STRUCT_SIZE,
            },
            duration::{
                Duration, DurationDatumPayloadChunkEncoder, DurationDecoder, DurationEncoder,
            },
            enums::{Enum, EnumDatumPayloadChunkEncoder, EnumDecoder, EnumEncoder, EnumRef},
            json::{Json, JsonDatumPayloadChunkEncoder, JsonDecoder, JsonEncoder, JsonRef},
            time::{Time, TimeDatumPayloadChunkEncoder, TimeDe
    
    pub fn append_bit_datum(&mut self, src_datum: &[u8], field_type: &FieldType) -> Result<()> {
        if src_datum.is_empty() {
            return Err(Error::InvalidDataType(
                "Failed to decode datum flag".to_owned(),
            ));
        }
        let flag = src_datum[0];
        let mut raw_datum = &src_datum[1..];
        let start_idx: usize = ((64 - field_type.as_accessor().flen()) / 8) as usize;
        match flag {
            datum::NIL_FLAG => self.append_null(),
            datum::UINT_FLAG => {
                self.append_bytes(&raw_datum.read_datum_payload_u64()?.to_be_bytes()[start_idx..])?
            }
            datum::VAR_UINT_FLAG => self.append_bytes(
                &raw_datum.read_datum_payload_var_u64()?.to_be_bytes()[start_idx..],
            )?,
            _ => {
                return Err(Error::InvalidDataType(format!(
                    "Unsupported datum flag {} for Bit vector",
                    flag
                )));
            }
        }
        Ok(())
    }