Struct igd_next::Gateway

source ·
pub struct Gateway {
    pub addr: SocketAddr,
    pub root_url: String,
    pub control_url: String,
    pub control_schema_url: String,
    pub control_schema: HashMap<String, Vec<String>>,
}
Expand description

This structure represents a gateway found by the search functions.

Fields§

§addr: SocketAddr

Socket address of the gateway

§root_url: String

Root url of the device

§control_url: String

Control url of the device

§control_schema_url: String

Url to get schema data from

§control_schema: HashMap<String, Vec<String>>

Control schema for all actions

Implementations§

Get the external IP address of the gateway.

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.

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.

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.

Remove a port mapping.

source

pub fn get_generic_port_mapping_entry(
    &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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more