1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/// Get expression as [`ipnet::IpNet`]
///
/// Shorthand for `expr.parse::<IpNet>().unwrap()`
///
/// # Examples
///
/// ```rust
/// use wireguard_conf::as_ipnet;
/// use ipnet::IpNet;
///
/// # fn main() {
/// assert_eq!(as_ipnet!("1.2.3.4/24"), "1.2.3.4/24".parse().unwrap());
/// assert_eq!(as_ipnet!("fd00:DEAD:BEEF::1/24"), "fd00:DEAD:BEEF::1/24".parse().unwrap());
/// # }
/// ```
/// Get expression as [`std::net::IpAddr`]
///
/// Shorthand for `expr.parse::<IpAddr>().unwrap()`
///
/// # Examples
///
/// ```rust
/// use wireguard_conf::as_ipaddr;
/// use std::net::IpAddr;
///
/// # fn main() {
/// assert_eq!(as_ipaddr!("1.2.3.4"), "1.2.3.4".parse::<IpAddr>().unwrap());
/// assert_eq!(as_ipaddr!("fd00:DEAD:BEEF::1"), "fd00:DEAD:BEEF::1".parse::<IpAddr>().unwrap());
/// # }
/// ```