Struct netaddr::addr::ipv6::IpAddrExperimental
[-]
[+]
[src]
pub struct IpAddr(pub u16, pub u16, pub u16, pub u16, pub u16, pub u16, pub u16, pub u16);
Methods
impl IpAddr
fn version(&self) -> IpAddrVersion
Get the corresponding IP address version.
fn max_prefixlen(&self) -> usize
The total number of bits in the address representation for this version: 32
for IPv4, 128
for IPv6.
The prefix defines the number of leading bits in an address that are compared to determine whether or not an address is part of a network.
fn with_prefixlen(n: usize) -> IpAddr
Create an IP mask with the specified prefixlen.
The provided prefixlen must be in the prefixlen-range (0
<= n
<= 128
).
fn packed(&self) -> [u8, ..16]
The binary representation of this address - a bytes vector of the appropriate length (most significant octet first). This is 4 bytes for IPv4 and 16 bytes for IPv6.
fn from_u128(n: [u64, ..2]) -> IpAddr
Create an IpAddr
instance from a 128-bits integer.
As Rust doesn't support u128-bits integer natively, this method take an array of two u64-bits integers
fn to_u128(&self) -> [u64, ..2]
Convert an IpAddr
instance to a 128-bits integer.
As Rust doesn't support u128-bits integer natively, this method return an array of two u64-bits integers
fn from_simd(n: u64x2) -> IpAddr
Create an IpAddr
instance from a 128-bits SIMD integer.
fn to_simd(&self) -> u64x2
Convert an IpAddr
instance to a 128-bits SIMD integer.
impl IpAddr
Convert operations from/to Rust's standard library IP addresses.
fn from_std(ip: StdIpAddr) -> Option<IpAddr>
Create an ipv6::IpAddr
instance from a Rust's standard library IpAddr
instance.
fn to_std(&self) -> StdIpAddr
Create a Rust's standard library IpAddr
instance from an ipv6::IpAddr
instance.
fn into_std(self) -> StdIpAddr
Convert an ipv6::IpAddr
instance into a Rust's standard library IpAddr
instance.
Trait Implementations
impl Add<u64> for IpAddr
impl Sub<u64> for IpAddr
impl BitXor<IpAddr> for IpAddr
type Output = IpAddr
fn bitxor(self, rhs: IpAddr) -> IpAddr
Use SIMD to do operations on 128-bits integer.
impl BitOr<IpAddr> for IpAddr
type Output = IpAddr
fn bitor(self, rhs: IpAddr) -> IpAddr
Use SIMD to do operations on 128-bits integer.
impl BitAnd<IpAddr> for IpAddr
type Output = IpAddr
fn bitand(self, rhs: IpAddr) -> IpAddr
Use SIMD to do operations on 128-bits integer.