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.
impl<'a> Copy for IpAddrRef<'a>
impl<'a> Eq for IpAddrRef<'a>
impl<'a> StructuralPartialEq for IpAddrRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for IpAddrRef<'a>
impl<'a> RefUnwindSafe for IpAddrRef<'a>
impl<'a> Send for IpAddrRef<'a>
impl<'a> Sync for IpAddrRef<'a>
impl<'a> Unpin for IpAddrRef<'a>
impl<'a> UnwindSafe for IpAddrRef<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)