1#![deny(missing_docs)]
2
3extern crate attohttpc;
8#[macro_use]
9extern crate log;
10#[cfg(feature = "aio")]
11extern crate bytes;
12
13extern crate rand;
14extern crate url;
15extern crate xmltree;
16
17#[cfg(feature = "aio")]
18extern crate futures;
19#[cfg(feature = "aio")]
20extern crate http;
21#[cfg(feature = "aio")]
22extern crate hyper;
23#[cfg(feature = "aio")]
24extern crate tokio;
25
26pub use self::common::parsing::PortMappingEntry;
28pub use self::common::SearchOptions;
29pub use self::errors::{
30 AddAnyPortError, AddPortError, GetExternalIpError, GetGenericPortMappingEntryError, RemovePortError, RequestError,
31 SearchError,
32};
33pub use self::errors::{Error, Result};
34pub use self::gateway::Gateway;
35
36pub use self::search::search_gateway;
38
39#[cfg(feature = "aio")]
40pub mod aio;
41mod common;
42mod errors;
43mod gateway;
44mod search;
45
46use std::fmt;
47
48#[derive(Debug, Clone, Copy, PartialEq)]
50pub enum PortMappingProtocol {
51 TCP,
53 UDP,
55}
56
57impl fmt::Display for PortMappingProtocol {
58 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
59 write!(
60 f,
61 "{}",
62 match *self {
63 PortMappingProtocol::TCP => "TCP",
64 PortMappingProtocol::UDP => "UDP",
65 }
66 )
67 }
68}