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: dm.rs
    path of file: ./repos/dm-ticket/src/clients
    
    the code of the file until where you have to start completion: use super::token::TokenClient;
use crate::models::{ticket::TicketInfoParams, DmRes, DmToken};
use anyhow::Result;
use reqwest::{
    header::{HeaderMap, HeaderValue},
    Client,
};
use serde_json::{json, Value};

#[derive(Debug)]
pub struct DmClient {
    pub client: Client,
    pub token_client: Option<TokenClient>,
    pub token: DmToken,
}

// 获取token
pub async fn get_token(cookie: &str) -> Result<DmToken> {
    let mut headers = HeaderMap::new();

    let url = "https://mtop.damai.cn/";

    headers.append("origin", HeaderValue::from_str(url)?);
    headers.append("referer", HeaderValue::from_str(url)?);
    headers.append("cookie", HeaderValue::from_str(cookie)?);
    let client = reqwest::Client::builder()
        .default_headers(headers)
        .cookie_store(true)
        .http2_prior_knowledge()
        .build()?;

    let mut token = DmToken {
        enc_token: "".to
    
    pub async fn new(cookie: Option<String>, token_client: Option<TokenClient>) -> Result<Self> {
        let cookie = cookie
            .unwrap_or("".to_string())
            .replace(' ', "")
            .replace('\n', "")
            .split(';')
            .filter(|e| !e.starts_with("_m_h5_tk"))
            .collect::<Vec<&str>>()
            .join(";");

        let token = get_token(&cookie).await?;

        let mut headers = HeaderMap::new();

        let base_url = "https://mtop.damai.cn/";

        headers.append("origin", HeaderValue::from_str(base_url)?);

        headers.append("referer", HeaderValue::from_str(base_url)?);

        headers.append(
            "cookie",
            HeaderValue::from_str(
                format!(
                    "{};_m_h5_tk_enc={};_m_h5_tk={};",
                    &cookie, token.enc_token, token.token_with_time
                )
                .as_str(),
            )?,
        );
        let client = reqwest::Client::builder()
            .default_headers(headers)
            .cookie_store(true)
            .http2_prior_knowledge()
            .user_agent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36")
            .use_rustls_tls()
            .build()?;
        Ok(Self {
            client,
            token,
            token_client,
        })
    }