1#![deny(missing_docs)]
2
3pub use self::common::parsing::PortMappingEntry;
9pub use self::common::SearchOptions;
10pub use self::errors::{
11 AddAnyPortError, AddPortError, GetExternalIpError, GetGenericPortMappingEntryError, RemovePortError, RequestError,
12 SearchError,
13};
14pub use self::errors::{Error, Result};
15pub use self::gateway::Gateway;
16
17pub use self::search::search_gateway;
19
20#[cfg(any(feature = "aio_tokio", feature = "aio_async_std"))]
21pub mod aio;
22mod common;
23mod errors;
24mod gateway;
25mod search;
26
27use std::fmt;
28
29#[derive(Debug, Clone, Copy, PartialEq, Eq)]
31pub enum PortMappingProtocol {
32 TCP,
34 UDP,
36}
37
38impl fmt::Display for PortMappingProtocol {
39 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
40 write!(
41 f,
42 "{}",
43 match *self {
44 PortMappingProtocol::TCP => "TCP",
45 PortMappingProtocol::UDP => "UDP",
46 }
47 )
48 }
49}