[−][src]Struct igd::tokio::Gateway
This structure represents a gateway found by the search functions.
Methods
impl Gateway
[src]
pub fn new(addr: SocketAddrV4, control_url: String, handle: Handle) -> Gateway
[src]
Create a new Gateway for a given Handle to a control loop
pub fn get_external_ip(
&self
) -> Box<dyn Future<Item = Ipv4Addr, Error = GetExternalIpError>>
[src]
&self
) -> Box<dyn Future<Item = Ipv4Addr, Error = GetExternalIpError>>
Get the external IP address of the gateway in a tokio compatible way
pub fn get_any_address(
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Box<dyn Future<Item = SocketAddrV4, Error = AddAnyPortError>>
[src]
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Box<dyn Future<Item = SocketAddrV4, Error = AddAnyPortError>>
Get an external socket address with our external ip and any port. This is a convenience
function that calls get_external_ip
followed by add_any_port
The local_addr is the address where the traffic is sent to. The lease_duration parameter is in seconds. A value of 0 is infinite.
Returns
The external address that was mapped on success. Otherwise an error.
pub fn add_any_port(
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Box<dyn Future<Item = u16, Error = AddAnyPortError>>
[src]
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Box<dyn Future<Item = u16, Error = AddAnyPortError>>
Add a port mapping.with any external port.
The local_addr is the address where the traffic is sent to. The lease_duration parameter is in seconds. A value of 0 is infinite.
Returns
The external port that was mapped on success. Otherwise an error.
pub fn add_port(
&self,
protocol: PortMappingProtocol,
external_port: u16,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Box<dyn Future<Item = (), Error = AddPortError>>
[src]
&self,
protocol: PortMappingProtocol,
external_port: u16,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Box<dyn Future<Item = (), Error = AddPortError>>
Add a port mapping.
The local_addr is the address where the traffic is sent to. The lease_duration parameter is in seconds. A value of 0 is infinite.
pub fn remove_port(
&self,
protocol: PortMappingProtocol,
external_port: u16
) -> Box<dyn Future<Item = (), Error = RemovePortError>>
[src]
&self,
protocol: PortMappingProtocol,
external_port: u16
) -> Box<dyn Future<Item = (), Error = RemovePortError>>
Remove a port mapping.
Trait Implementations
impl Clone for Gateway
[src]
fn clone(&self) -> Gateway
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Gateway
[src]
impl PartialEq<Gateway> for Gateway
[src]
fn eq(&self, other: &Gateway) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Display for Gateway
[src]
impl Debug for Gateway
[src]
impl Hash for Gateway
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.