pub fn open(&self) -> io::Result<(Sender, Receiver)> {
        let inters = datalink::interfaces();
        let inter = inters
            .into_iter()
            .filter(|current_inter| current_inter.name == self.name)
            .next()
            .ok_or(io::Error::new(
                io::ErrorKind::NotFound,
                "interface not found",
            ))?;

        let mut config = Config::default();
        config.write_buffer_size = BUFFER_SIZE;
        config.read_buffer_size = BUFFER_SIZE;
        let channel = datalink::channel(&inter, config)?;
        let channel = match channel {
            Channel::Ethernet(tx, rx) => (tx, rx),
            _ => return Err(io::Error::new(io::ErrorKind::Other, "unknown link type")),
        };

        Ok(channel)
    }
// Opens the network interface for sending and receiving data.
Opens the network interface for sending and receiving data.
Opens the network interface for sending and receiving data .
pub fn open(&self) -> io::Result<(Sender, Receiver)> {
        let inters = datalink::interfaces();
        let inter = inters
            .into_iter()
            .filter(|current_inter| current_inter.name == self.name)
            .next()
            .ok_or(io::Error::new(
                io::ErrorKind::NotFound,
                "interface not found",
            ))?;
        let mut config = Config::default();
        config.write_buffer_size = BUFFER_SIZE;
        config.read_buffer_size = BUFFER_SIZE;
        let channel = datalink::channel(&inter, config)?;
        let channel = match channel {
            Channel::Ethernet(tx, rx) => (tx, rx),
            _ => return Err(io::Error::new(io::ErrorKind::Other, "unknown link type")),
        };
        Ok(channel)
    }
pub fn open ( & self ) -> io :: Result < ( Sender , Receiver ) > { let inters = datalink :: interfaces ( ) ; let inter = inters . into_iter ( ) . filter ( | current_inter | current_inter . name == self . name ) . next ( ) . ok_or ( io :: Error :: new ( io :: ErrorKind :: NotFound , " " , ) ) ? ; let mut config = Config :: default ( ) ; config . write_buffer_size = BUFFER_SIZE ; config . read_buffer_size = BUFFER_SIZE ; let channel = datalink :: channel ( & inter , config ) ? ; let channel = match channel { Channel :: Ethernet ( tx , rx ) => ( tx , rx ) , _ => return Err ( io :: Error :: new ( io :: ErrorKind :: Other , " " ) ) , } ; Ok ( channel ) }
Opens the network interface for sending and receiving data.
Opens the network interface for sending and receiving data .
&self