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: udp.rs
    path of file: ./repos/CYFS/src/component/cyfs-bdt/src/ndn/channel/tunnel
    
    the code of the file until where you have to start completion: use log::*;
use std::{
    collections::{LinkedList},
    time::{Duration, Instant},
    cell::RefCell, 
    sync::Mutex
};
use async_std::{
    sync::Arc, 
};
use cyfs_base::*;
use crate::{
    types::*, 
    interface::udp::MTU, 
    tunnel::{udp::Tunnel as RawTunnel, Tunnel, DynamicTunnel, TunnelState}, 
    cc::{self, CongestionControl},
};
use super::super::super::{
    chunk::ChunkEncoder
};
use super::super::{
    protocol::v0::*, 
    channel::{self}
};
    
    fn on_piece_data(&mut self) {
        let now = bucky_time_now();
        if let Some(last_pushed) = self.last_pushed {
            if now > last_pushed.time() {
                match last_pushed {
                    LastPushed::PieceData(at) => {
                        let interval = u64::max(now - at, self.config.udp.cc.min_rto.as_micros() as u64);
                        let interval = u64::min(self.config.block_interval.as_micros() as u64, interval);
                        self.last_pushed = Some(LastPushed::PieceData(now));
                        self.next_send_time = Some(now + interval);
                    },
                    LastPushed::RespInterest(_) => {
                        self.last_pushed = Some(LastPushed::PieceData(now));
                        self.next_send_time = Some(now + self.config.block_interval.as_micros() as u64);
                    }
                }
            }
        } else {
            self.last_pushed = Some(LastPushed::PieceData(now));
            self.next_send_time = Some(now + self.config.block_interval.as_micros() as u64);
        }
    }