pub trait PortMapping: Send + Sync {
// Required methods
fn start(
self: Arc<Self>,
settings: Arc<AsyncRwLock<Settings>>,
executor: ExecutorPtr,
) -> Result<()>;
fn stop(self: Arc<Self>);
}Expand description
Trait for port mapping protocols (UPnP, NAT-PMP, PCP)
Each protocol runs its own persistent task that:
- Attempts to discover a gateway
- Creates port mappings when gateway is found
- Periodically refreshes the external address
- Retries discovery on failures (supports roaming)