use igd::aio::*; use log::*; use tokio::sync::broadcast; use anyhow::{Result, Context}; use std::cell::Cell; use crate::diplonat::*; use crate::node_state::*; pub struct IgdAdapter<'a> { state: &'a Cell, gateway: Gateway, } impl<'a> IgdAdapter<'a> { pub async fn new(ns: &'a Cell, send: &broadcast::Sender<()>) -> Result> { let gw = search_gateway(Default::default()) .await .context("Failed to find gateway")?; info!("Gateway: {}", gw); let ctx = Self { state: ns, gateway: gw }; return Ok(ctx); } fn run(&self) -> Result<()> { return Ok(()); } }