pub enum IpAddrRef<'a> {
V4(&'a [u8], [u8; 4]),
V6(&'a [u8], [u8; 16]),
}
Expand description
Either a IPv4 or IPv6 address, plus its borrowed string representation
Variants§
V4(&'a [u8], [u8; 4])
An IPv4 address and its borrowed string representation
V6(&'a [u8], [u8; 16])
An IPv6 address and its borrowed string representation
Implementations§
source§impl<'a> IpAddrRef<'a>
impl<'a> IpAddrRef<'a>
sourcepub fn try_from_ascii(ip_address: &'a [u8]) -> Result<Self, AddrParseError>
pub fn try_from_ascii(ip_address: &'a [u8]) -> Result<Self, AddrParseError>
Constructs an IpAddrRef
from the given input if the input is
a valid IPv4 or IPv6 address.
sourcepub fn try_from_ascii_str(ip_address: &'a str) -> Result<Self, AddrParseError>
pub fn try_from_ascii_str(ip_address: &'a str) -> Result<Self, AddrParseError>
Constructs an IpAddrRef
from the given input if the input is a
valid IP address.
Trait Implementations§
source§impl<'a> From<IpAddrRef<'a>> for SubjectNameRef<'a>
impl<'a> From<IpAddrRef<'a>> for SubjectNameRef<'a>
source§fn from(dns_name: IpAddrRef<'a>) -> SubjectNameRef<'_>
fn from(dns_name: IpAddrRef<'a>) -> SubjectNameRef<'_>
Converts to this type from the input type.