Skip to main content

NatContext

Trait NatContext 

Source
pub trait NatContext<I: IpExt, BT: FilterBindingsTypes>: IpDeviceAddressIdContext<I, DeviceId: InterfaceProperties<BT::DeviceClass>> {
    // Required methods
    fn get_local_addr_for_remote(
        &mut self,
        device_id: &Self::DeviceId,
        remote: Option<SpecifiedAddr<I::Addr>>,
    ) -> Option<Self::AddressId>;
    fn get_address_id(
        &mut self,
        device_id: &Self::DeviceId,
        addr: IpDeviceAddr<I::Addr>,
    ) -> Option<Self::AddressId>;
}
Expand description

The execution context for Network Address Translation (NAT).

Required Methods§

Source

fn get_local_addr_for_remote( &mut self, device_id: &Self::DeviceId, remote: Option<SpecifiedAddr<I::Addr>>, ) -> Option<Self::AddressId>

Returns the best local address for communicating with the remote.

Source

fn get_address_id( &mut self, device_id: &Self::DeviceId, addr: IpDeviceAddr<I::Addr>, ) -> Option<Self::AddressId>

Returns a strongly-held reference to the provided address, if it is assigned to the specified device.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§