1 2 3 4 5 6 7 8 9 10 11 12 13
use igd::aio::Gateway; use igd::aio::search_gateway; use anyhow::{Result, Context}; use log::*; pub async fn get_gateway() -> Result<igd::aio::Gateway> { let gw = search_gateway(Default::default()) .await .context("Failed to find gateway")?; info!("Gateway: {}", gw); return Ok(gw); }