use anyhow::{Result, Context}; use crate::*; pub struct Diplonat { pub config: config::DiplonatConfig, pub gateway: igd::aio::Gateway } impl Diplonat { pub async fn new() -> Result { let ctx = Self { config: config::load_env().context("Unable to read configuration from environment")?, gateway: gw::get_gateway().await? }; return Ok(ctx); } pub fn listen(&self) -> bool { return true; } }