[−][src]Struct igd::Gateway
This structure represents a gateway found by the search functions.
Fields
addr: SocketAddrV4
Socket address of the gateway
control_url: String
Control url of the device
Methods
impl Gateway
[src]
pub fn get_external_ip(&self) -> Result<Ipv4Addr, GetExternalIpError>
[src]
Get the external IP address of the gateway.
pub fn get_any_address(
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Result<SocketAddrV4, AddAnyPortError>
[src]
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Result<SocketAddrV4, 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
) -> Result<u16, AddAnyPortError>
[src]
&self,
protocol: PortMappingProtocol,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Result<u16, 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
) -> Result<(), AddPortError>
[src]
&self,
protocol: PortMappingProtocol,
external_port: u16,
local_addr: SocketAddrV4,
lease_duration: u32,
description: &str
) -> Result<(), 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
) -> Result<(), RemovePortError>
[src]
&self,
protocol: PortMappingProtocol,
external_port: u16
) -> Result<(), RemovePortError>
Remove a port mapping.
pub fn get_generic_port_mapping_entry(
&self,
index: u32
) -> Result<PortMappingEntry, GetGenericPortMappingEntryError>
[src]
&self,
index: u32
) -> Result<PortMappingEntry, GetGenericPortMappingEntryError>
Get one port mapping entry
Gets one port mapping entry by its index. Not all existing port mappings might be visible to this client. If the index is out of bound, GetGenericPortMappingEntryError::SpecifiedArrayIndexInvalid will be returned
Trait Implementations
impl Clone for Gateway
[src]
impl Debug for Gateway
[src]
impl Display for Gateway
[src]
impl Eq for Gateway
[src]
impl Hash for Gateway
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Gateway> for Gateway
[src]
impl StructuralEq for Gateway
[src]
impl StructuralPartialEq for Gateway
[src]
Auto Trait Implementations
impl RefUnwindSafe for Gateway
impl Send for Gateway
impl Sync for Gateway
impl Unpin for Gateway
impl UnwindSafe for Gateway
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,