cidr/inet/
from_str.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{
	errors::NetworkParseError,
	local_addr_parser::ParseableAddress,
	Inet,
};

pub fn inet_from_str<I>(s: &str) -> Result<I, NetworkParseError>
where
	I: Inet,
	I::Address: ParseableAddress,
{
	// TODO: use strict FromStr::from_str address parsing with version bump
	crate::parsers::parse_inet(s, I::Address::address_from_str)
}