Trait net_types::ip::GenericOverIp
source · pub trait GenericOverIp<NewIp: Ip> {
type Type;
}
Expand description
Marks types that are generic over IP version.
This should be implemented by types that contain a generic parameter
I: Ip
or A: IpAddress
to allow them to be used with
Ip::map_ip
.
Implementations of this trait should generally be themselves generic over
Ip
. For example:
struct AddrAndSubnet<I: Ip> {
addr: I::Addr,
subnet: Subnet<I::Addr>
}
impl <I: Ip, NewIp: Ip> GenericOverIp<NewIp> for AddrAndSubnet<I> {
type Type = AddrAndSubnet<NewIp>;
}