pub fn delete_ports(
configs: impl IntoIterator<Item = UpnpConfig>,
) -> impl Iterator<Item = Result<(), Error>>Expand description
Delete port mappings.
This function takes an iterable of UpnpConfigs and closes all configures ports.
Errors are logged, but otherwise ignored. An error during closing a port will not stop the processing of the other ports.
ยงExample
use log::error;
use easy_upnp::{delete_ports, PortMappingProtocol, UpnpConfig};
let config = UpnpConfig {
address: None,
port: 80,
protocol: PortMappingProtocol::TCP,
duration: 3600,
comment: "Webserver".to_string(),
};
for result in delete_ports([config]) {
if let Err(err) = result {
error!("{}", err);
}
}