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: embassy_net.rs
    path of file: ./repos/embassy/embassy-usb/src/class/cdc_ncm
    
    the code of the file until where you have to start completion: //! [`embassy-net`](https://crates.io/crates/embassy-net) driver for the CDC-NCM class.

use embassy_futures::select::{select, Either};
use embassy_net_driver_channel as ch;
use embassy_net_driver_channel::driver::LinkState;
use embassy_usb_driver::Driver;

use super::{CdcNcmClass, Receiver, Sender};

/// Internal state for the embassy-net integration.
pub struct State<const MTU: usize, const N_RX: usize, const N_TX: usize> {
    ch_state: ch::State<MTU, N_RX, N_TX>,
}

impl<const MTU: usize, const N_
    
    pub async fn run(mut self) -> ! {
        let (state_chan, mut rx_chan, mut tx_chan) = self.ch.split();
        let rx_fut = async move {
            loop {
                trace!("WAITING for connection");
                state_chan.set_link_state(LinkState::Down);

                self.rx_usb.wait_connection().await.unwrap();

                trace!("Connected");
                state_chan.set_link_state(LinkState::Up);

                loop {
                    let p = rx_chan.rx_buf().await;
                    match self.rx_usb.read_packet(p).await {
                        Ok(n) => rx_chan.rx_done(n),
                        Err(e) => {
                            warn!("error reading packet: {:?}", e);
                            break;
                        }
                    };
                }
            }
        };
        let tx_fut = async move {
            loop {
                let p = tx_chan.tx_buf().await;
                if let Err(e) = self.tx_usb.write_packet(p).await {
                    warn!("Failed to TX packet: {:?}", e);
                }
                tx_chan.tx_done();
            }
        };
        match select(rx_fut, tx_fut).await {
            Either::First(x) => x,
            Either::Second(x) => x,
        }
    }