#[cfg(feature = "tun")]
use crate::{tun::tun_async_device::TunDevice, udp::socket::UdpSocketFactory};
use crate::{
tun::{IpRecv, IpSend},
udp::UdpTransportFactory,
};
#[cfg(feature = "tun")]
pub type DefaultDeviceTransports = (UdpSocketFactory, TunDevice, TunDevice);
pub trait DeviceTransports: 'static {
type UdpTransportFactory: UdpTransportFactory;
type IpSend: IpSend;
type IpRecv: IpRecv;
}
impl<UF, IS, IR> DeviceTransports for (UF, IS, IR)
where
UF: UdpTransportFactory,
IS: IpSend,
IR: IpRecv,
{
type UdpTransportFactory = UF;
type IpSend = IS;
type IpRecv = IR;
}
impl<UF, IP> DeviceTransports for (UF, IP)
where
UF: UdpTransportFactory,
IP: IpSend + IpRecv + Clone,
{
type UdpTransportFactory = UF;
type IpSend = IP;
type IpRecv = IP;
}