ip!() { /* proc-macro */ }Expand description
Generate an IP address from the standard textual representation (both support IPv4 and IPv6)
§Syntax
This macro works as a function which take only one argument: the string representation of an IP address
§Example
assert_eq!(ip!("::1"), std::net::IpAddr::V6(std::net::Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)));
assert_eq!(ip!("192.168.1.5"), std::net::IpAddr::V4(std::net::Ipv4Addr::new(192, 168, 1, 5)));