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: tunnel.rs
    path of file: ./repos/CYFS/src/component/cyfs-bdt/src/tunnel
    
    the code of the file until where you have to start completion: use std::any::Any;
use async_trait::{async_trait};
use cyfs_base::*;
use crate::{types::*, protocol};

#[derive(Eq, PartialEq, Debug, Clone)]
pub enum ProxyType {
    None, 
    Active(DeviceId), 
    Passive(DeviceId)
}

impl ProxyTyp
    
    fn clone(&self) -> Self {
        use super::udp;
        use super::tcp;

        if self.as_ref().local().is_udp() {
            Self::new(self.clone_as_tunnel::<udp::Tunnel>())
        } else if self.as_ref().local().is_tcp() {
            Self::new(self.clone_as_tunnel::<tcp::Tunnel>())
        } else {
            unreachable!()
        }
    }