macro_rules! for_any_ip_version { ($ip_version:expr, $type_param:ident, $expression:expr) => { ... }; }
Expand description
Evaluates expression
for any given ip_version
.
type_param
will be defined to be crate::ip::Ipv4
for
crate::ip::IpVersion::V4
, and crate::ip::Ipv6
for
crate::ip::IpVersion::V6
.
Example usage:
let ip_version: IpVersion = foo();
for_any_ip_version!(ip_version, I, some_ip_generic_fn::<I>());