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: mitm.rs
    path of file: ./repos/Good-MITM/crates/core/src
    
    the code of the file until where you have to start completion: use crate::{
    ca::CertificateAuthority,
    handler::{CustomContextData, HttpHandler, MitmFilter},
    http_client::HttpClient
    
    async fn process_connect(self, req: Request<Body>) -> Result<Response<Body>, hyper::Error> {
        let ctx = HttpContext {
            uri: None,
            should_modify_response: false,
            ..Default::default()
        };

        if self.mitm_filter.filter_req(&ctx, &req).await {
            tokio::task::spawn(async move {
                let authority = req
                    .uri()
                    .authority()
                    .expect("URI does not contain authority")
                    .clone();

                match hyper::upgrade::on(req).await {
                    Ok(upgraded) => {
                        self.serve_tls(upgraded).await;
                    }
                    Err(e) => debug!("upgrade error for {}: {}", authority, e),
                };
            });
        } else {
            tokio::task::spawn(async move {
                let remote_addr = host_addr(req.uri()).unwrap();
                let upgraded = hyper::upgrade::on(req).await.unwrap();
                tunnel(upgraded, remote_addr).await
            });
        }
        Ok(Response::new(Body::empty()))
    }