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

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,

§

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,

§

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

source§

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

source§

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

§

type Type = ()

source§

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

§

type Type = bool

source§

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

§

type Type = i8

source§

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

§

type Type = i16

source§

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

§

type Type = i32

source§

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

§

type Type = i64

source§

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

§

type Type = isize

source§

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

§

type Type = u8

source§

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

§

type Type = u16

source§

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

§

type Type = u32

source§

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

§

type Type = u64

source§

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

§

type Type = usize

source§

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

§

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>

§

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

source§

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

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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

source§

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

§

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

Implementors§

source§

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

§

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

source§

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

§

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

source§

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

§

type Type = ZonedAddr<<A as GenericOverIp<I>>::Type, Z>

source§

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

§

type Type = AddrAndZone<<A as GenericOverIp<I>>::Type, Z>

source§

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

§

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

source§

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

§

type Type = <I as Ip>::Addr

source§

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

§

type Type = <I as Ip>::Addr

source§

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

§

type Type = IpVersionMarker<IpType>

source§

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

§

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,

§

type Type = IpMarked<IpType, T>