[−][src]Struct domain_core::rdata::rfc3596::Aaaa
Methods
impl Aaaa
[src]
pub fn new(addr: Ipv6Addr) -> Aaaa
[src]
pub fn addr(&self) -> Ipv6Addr
[src]
pub fn set_addr(&mut self, addr: Ipv6Addr)
[src]
Methods from Deref<Target = Ipv6Addr>
pub const LOCALHOST: Ipv6Addr
1.30.0[src]
pub const UNSPECIFIED: Ipv6Addr
1.30.0[src]
pub fn segments(&self) -> [u16; 8]
1.0.0[src]
Returns the eight 16-bit segments that make up this address.
Examples
use std::net::Ipv6Addr; assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).segments(), [0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff]);
pub fn is_unspecified(&self) -> bool
1.7.0[src]
Returns true
for the special 'unspecified' address (::).
This property is defined in IETF RFC 4291.
Examples
use std::net::Ipv6Addr; assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unspecified(), false); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0).is_unspecified(), true);
pub fn is_loopback(&self) -> bool
1.7.0[src]
Returns true
if this is a loopback address (::1).
This property is defined in IETF RFC 4291.
Examples
use std::net::Ipv6Addr; assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_loopback(), false); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1).is_loopback(), true);
pub fn is_global(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns true
if the address appears to be globally routable.
The following return false
:
- the loopback address
- link-local, site-local, and unique local unicast addresses
- interface-, link-, realm-, admin- and site-local multicast addresses
Examples
#![feature(ip)] use std::net::Ipv6Addr; fn main() { assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_global(), true); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1).is_global(), false); assert_eq!(Ipv6Addr::new(0, 0, 0x1c9, 0, 0, 0xafc8, 0, 0x1).is_global(), true); }
pub fn is_unique_local(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns true
if this is a unique local address (fc00::/7).
This property is defined in IETF RFC 4193.
Examples
#![feature(ip)] use std::net::Ipv6Addr; fn main() { assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unique_local(), false); assert_eq!(Ipv6Addr::new(0xfc02, 0, 0, 0, 0, 0, 0, 0).is_unique_local(), true); }
pub fn is_unicast_link_local(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns true
if the address is unicast and link-local (fe80::/10).
This property is defined in IETF RFC 4291.
Examples
#![feature(ip)] use std::net::Ipv6Addr; fn main() { assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unicast_link_local(), false); assert_eq!(Ipv6Addr::new(0xfe8a, 0, 0, 0, 0, 0, 0, 0).is_unicast_link_local(), true); }
pub fn is_unicast_site_local(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns true
if this is a deprecated unicast site-local address
(fec0::/10).
Examples
#![feature(ip)] use std::net::Ipv6Addr; fn main() { assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unicast_site_local(), false); assert_eq!(Ipv6Addr::new(0xfec2, 0, 0, 0, 0, 0, 0, 0).is_unicast_site_local(), true); }
pub fn is_documentation(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns true
if this is an address reserved for documentation
(2001:db8::/32).
This property is defined in IETF RFC 3849.
Examples
#![feature(ip)] use std::net::Ipv6Addr; fn main() { assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_documentation(), false); assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_documentation(), true); }
pub fn is_unicast_global(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns true
if the address is a globally routable unicast address.
The following return false:
- the loopback address
- the link-local addresses
- the (deprecated) site-local addresses
- unique local addresses
- the unspecified address
- the address range reserved for documentation
Examples
#![feature(ip)] use std::net::Ipv6Addr; fn main() { assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_unicast_global(), false); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unicast_global(), true); }
pub fn multicast_scope(&self) -> Option<Ipv6MulticastScope>
[src]
🔬 This is a nightly-only experimental API. (ip
)
extra functionality has not been scrutinized to the level that it should be to be stable
Returns the address's multicast scope if the address is multicast.
Examples
#![feature(ip)] use std::net::{Ipv6Addr, Ipv6MulticastScope}; fn main() { assert_eq!(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0).multicast_scope(), Some(Ipv6MulticastScope::Global)); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).multicast_scope(), None); }
pub fn is_multicast(&self) -> bool
1.7.0[src]
Returns true
if this is a multicast address (ff00::/8).
This property is defined by IETF RFC 4291.
Examples
use std::net::Ipv6Addr; assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).is_multicast(), true); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_multicast(), false);
pub fn to_ipv4(&self) -> Option<Ipv4Addr>
1.0.0[src]
Converts this address to an IPv4 address. Returns None
if this address is
neither IPv4-compatible or IPv4-mapped.
::a.b.c.d and ::ffff:a.b.c.d become a.b.c.d
Examples
use std::net::{Ipv4Addr, Ipv6Addr}; assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).to_ipv4(), None); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).to_ipv4(), Some(Ipv4Addr::new(192, 10, 2, 255))); assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1).to_ipv4(), Some(Ipv4Addr::new(0, 0, 0, 1)));
pub const fn octets(&self) -> [u8; 16]
1.12.0[src]
Returns the sixteen eight-bit integers the IPv6 address consists of.
use std::net::Ipv6Addr; assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).octets(), [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
Trait Implementations
impl Compose for Aaaa
[src]
impl Compress for Aaaa
[src]
impl Parse for Aaaa
[src]
type Err = <Ipv6Addr as Parse>::Err
The type of an error returned when parsing fails.
fn parse(parser: &mut Parser) -> Result<Self, Self::Err>
[src]
fn skip(parser: &mut Parser) -> Result<(), Self::Err>
[src]
impl ParseAll for Aaaa
[src]
type Err = <Ipv6Addr as ParseAll>::Err
The type returned when parsing fails.
fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err>
[src]
impl RtypeRecordData for Aaaa
[src]
impl Scan for Aaaa
[src]
impl AsRef<Ipv6Addr> for Aaaa
[src]
impl AsMut<Ipv6Addr> for Aaaa
[src]
impl From<Ipv6Addr> for Aaaa
[src]
impl From<Aaaa> for Ipv6Addr
[src]
impl<N> From<Aaaa> for MasterRecordData<N>
[src]
impl<N> From<Aaaa> for AllRecordData<N>
[src]
impl PartialEq<Aaaa> for Aaaa
[src]
impl PartialOrd<Aaaa> for Aaaa
[src]
fn partial_cmp(&self, other: &Aaaa) -> Option<Ordering>
[src]
fn lt(&self, other: &Aaaa) -> bool
[src]
fn le(&self, other: &Aaaa) -> bool
[src]
fn gt(&self, other: &Aaaa) -> bool
[src]
fn ge(&self, other: &Aaaa) -> bool
[src]
impl Eq for Aaaa
[src]
impl Ord for Aaaa
[src]
fn cmp(&self, other: &Aaaa) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for Aaaa
[src]
fn clone(&self) -> Aaaa
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Aaaa
[src]
impl Display for Aaaa
[src]
impl Deref for Aaaa
[src]
impl DerefMut for Aaaa
[src]
impl Hash for Aaaa
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromStr for Aaaa
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> RecordData for T where
T: Compose + Compress + RtypeRecordData,
[src]
T: Compose + Compress + RtypeRecordData,
impl<T> ParseRecordData for T where
T: Compose + Compress + ParseAll + RtypeRecordData,
[src]
T: Compose + Compress + ParseAll + RtypeRecordData,
type Err = <T as ParseAll>::Err
The type of an error returned when parsing fails.
fn parse_data(
Rtype,
&mut Parser,
usize
) -> Result<Option<T>, <T as ParseRecordData>::Err>
[src]
Rtype,
&mut Parser,
usize
) -> Result<Option<T>, <T as ParseRecordData>::Err>
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,