net_types::ip

Trait 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>;
}

Required Associated Types§

Source

type Type

The type of Self when its IP-generic parameter is replaced with the type NewIp.

Implementations on Foreign Types§

Source§

impl<'s, NewIp: Ip, T: GenericOverIp<NewIp>> GenericOverIp<NewIp> for &'s T
where T::Type: 's,

Source§

type Type = &'s <T as GenericOverIp<NewIp>>::Type

Source§

impl<'s, NewIp: Ip, T: GenericOverIp<NewIp>> GenericOverIp<NewIp> for &'s mut T
where T::Type: 's,

Source§

type Type = &'s mut <T as GenericOverIp<NewIp>>::Type

Source§

impl<I: Ip> GenericOverIp<I> for Infallible

Source§

impl<I: Ip> GenericOverIp<I> for ()

Source§

impl<IpType: Ip> GenericOverIp<IpType> for bool

Source§

impl<IpType: Ip> GenericOverIp<IpType> for i8

Source§

impl<IpType: Ip> GenericOverIp<IpType> for i16

Source§

impl<IpType: Ip> GenericOverIp<IpType> for i32

Source§

impl<IpType: Ip> GenericOverIp<IpType> for i64

Source§

impl<IpType: Ip> GenericOverIp<IpType> for isize

Source§

impl<IpType: Ip> GenericOverIp<IpType> for u8

Source§

impl<IpType: Ip> GenericOverIp<IpType> for u16

Source§

impl<IpType: Ip> GenericOverIp<IpType> for u32

Source§

impl<IpType: Ip> GenericOverIp<IpType> for u64

Source§

impl<IpType: Ip> GenericOverIp<IpType> for usize

Source§

impl<IpType: Ip, R: GenericOverIp<IpType>, E: GenericOverIp<IpType>> GenericOverIp<IpType> for Result<R, E>

Source§

type Type = Result<<R as GenericOverIp<IpType>>::Type, <E as GenericOverIp<IpType>>::Type>

Source§

impl<IpType: Ip, T: GenericOverIp<IpType>> GenericOverIp<IpType> for Option<T>

Source§

type Type = Option<<T as GenericOverIp<IpType>>::Type>

Source§

impl<IpType: Ip, T: GenericOverIp<IpType>> GenericOverIp<IpType> for Vec<T>

Source§

type Type = Vec<<T as GenericOverIp<IpType>>::Type>

Source§

impl<P: Ip, A: GenericOverIp<P>, B: GenericOverIp<P>, C: GenericOverIp<P>, D: GenericOverIp<P>, E: GenericOverIp<P>, F: GenericOverIp<P>, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

type Type = (<A as GenericOverIp<P>>::Type, <B as GenericOverIp<P>>::Type, <C as GenericOverIp<P>>::Type, <D as GenericOverIp<P>>::Type, <E as GenericOverIp<P>>::Type, <F as GenericOverIp<P>>::Type, <G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, B: GenericOverIp<P>, C: GenericOverIp<P>, D: GenericOverIp<P>, E: GenericOverIp<P>, F: GenericOverIp<P>, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (B, C, D, E, F, G, H, I, J, K, L)

Source§

type Type = (<B as GenericOverIp<P>>::Type, <C as GenericOverIp<P>>::Type, <D as GenericOverIp<P>>::Type, <E as GenericOverIp<P>>::Type, <F as GenericOverIp<P>>::Type, <G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, C: GenericOverIp<P>, D: GenericOverIp<P>, E: GenericOverIp<P>, F: GenericOverIp<P>, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (C, D, E, F, G, H, I, J, K, L)

Source§

type Type = (<C as GenericOverIp<P>>::Type, <D as GenericOverIp<P>>::Type, <E as GenericOverIp<P>>::Type, <F as GenericOverIp<P>>::Type, <G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, D: GenericOverIp<P>, E: GenericOverIp<P>, F: GenericOverIp<P>, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (D, E, F, G, H, I, J, K, L)

Source§

type Type = (<D as GenericOverIp<P>>::Type, <E as GenericOverIp<P>>::Type, <F as GenericOverIp<P>>::Type, <G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, E: GenericOverIp<P>, F: GenericOverIp<P>, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (E, F, G, H, I, J, K, L)

Source§

type Type = (<E as GenericOverIp<P>>::Type, <F as GenericOverIp<P>>::Type, <G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, F: GenericOverIp<P>, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (F, G, H, I, J, K, L)

Source§

type Type = (<F as GenericOverIp<P>>::Type, <G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, G: GenericOverIp<P>, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (G, H, I, J, K, L)

Source§

type Type = (<G as GenericOverIp<P>>::Type, <H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, H: GenericOverIp<P>, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (H, I, J, K, L)

Source§

type Type = (<H as GenericOverIp<P>>::Type, <I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, I: GenericOverIp<P>, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (I, J, K, L)

Source§

type Type = (<I as GenericOverIp<P>>::Type, <J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, J: GenericOverIp<P>, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (J, K, L)

Source§

type Type = (<J as GenericOverIp<P>>::Type, <K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, K: GenericOverIp<P>, L: GenericOverIp<P>> GenericOverIp<P> for (K, L)

Source§

type Type = (<K as GenericOverIp<P>>::Type, <L as GenericOverIp<P>>::Type)

Source§

impl<P: Ip, L: GenericOverIp<P>> GenericOverIp<P> for (L,)

Source§

type Type = (<L as GenericOverIp<P>>::Type,)

Implementors§

Source§

impl<A, I: Ip> GenericOverIp<I> for SpecifiedAddr<A>

Source§

impl<A, I: Ip> GenericOverIp<I> for Subnet<A>

Source§

type Type = Subnet<<I as Ip>::Addr>

Source§

impl<A: GenericOverIp<I>, I: Ip, Z> GenericOverIp<I> for ZonedAddr<A, Z>

Source§

impl<A: GenericOverIp<I>, I: Ip, Z> GenericOverIp<I> for AddrAndZone<A, Z>

Source§

impl<A: IpAddress, I: Ip> GenericOverIp<I> for MulticastAddr<A>

Source§

impl<I: Ip> GenericOverIp<I> for Ipv4Addr

Source§

type Type = <I as Ip>::Addr

Source§

impl<I: Ip> GenericOverIp<I> for Ipv6Addr

Source§

type Type = <I as Ip>::Addr

Source§

impl<I: Ip, IpType> GenericOverIp<IpType> for IpVersionMarker<I>
where IpType: Ip,

Source§

impl<I: Ip, IpType> GenericOverIp<IpType> for PrefixLength<I>
where IpType: Ip,

Source§

type Type = PrefixLength<IpType>

Source§

impl<I: Ip, T> GenericOverIp<I> for IpInvariant<T>

Source§

impl<I: Ip, T, IpType> GenericOverIp<IpType> for IpMarked<I, T>
where IpType: Ip,

Source§

type Type = IpMarked<IpType, T>