Struct smoltcp::wire::Ipv6Address
source · [−]pub struct Ipv6Address(pub [u8; 16]);Expand description
A sixteen-octet IPv6 address.
Tuple Fields
0: [u8; 16]Implementations
sourceimpl Address
impl Address
sourcepub const UNSPECIFIED: Address = Address([0x00; 16])
pub const UNSPECIFIED: Address = Address([0x00; 16])
The unspecified address.
sourcepub const LINK_LOCAL_ALL_NODES: Address = Address([
0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01,
])
pub const LINK_LOCAL_ALL_NODES: Address = Address([ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, ])
The link-local all routers multicast address.
sourcepub const LINK_LOCAL_ALL_ROUTERS: Address = Address([
0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02,
])
pub const LINK_LOCAL_ALL_ROUTERS: Address = Address([ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, ])
The link-local all nodes multicast address.
sourcepub const LOOPBACK: Address = Address([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01,
])
pub const LOOPBACK: Address = Address([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, ])
The loopback address.
sourcepub fn new(
a0: u16,
a1: u16,
a2: u16,
a3: u16,
a4: u16,
a5: u16,
a6: u16,
a7: u16
) -> Address
pub fn new(
a0: u16,
a1: u16,
a2: u16,
a3: u16,
a4: u16,
a5: u16,
a6: u16,
a7: u16
) -> Address
Construct an IPv6 address from parts.
sourcepub fn from_bytes(data: &[u8]) -> Address
pub fn from_bytes(data: &[u8]) -> Address
Construct an IPv6 address from a sequence of octets, in big-endian.
Panics
The function panics if data is not sixteen octets long.
sourcepub fn from_parts(data: &[u16]) -> Address
pub fn from_parts(data: &[u16]) -> Address
Construct an IPv6 address from a sequence of words, in big-endian.
Panics
The function panics if data is not 8 words long.
sourcepub fn write_parts(&self, data: &mut [u16])
pub fn write_parts(&self, data: &mut [u16])
sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Query whether the IPv6 address is an unicast address.
sourcepub fn is_multicast(&self) -> bool
pub fn is_multicast(&self) -> bool
Query whether the IPv6 address is a multicast address.
sourcepub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Query whether the IPv6 address is the unspecified address.
sourcepub fn is_link_local(&self) -> bool
pub fn is_link_local(&self) -> bool
Query whether the IPv6 address is in the link-local scope.
sourcepub fn is_loopback(&self) -> bool
pub fn is_loopback(&self) -> bool
Query whether the IPv6 address is the loopback address.
sourcepub fn is_ipv4_mapped(&self) -> bool
pub fn is_ipv4_mapped(&self) -> bool
Query whether the IPv6 address is an IPv4 mapped IPv6 address.
sourcepub fn as_ipv4(&self) -> Option<Address>
pub fn as_ipv4(&self) -> Option<Address>
Convert an IPv4 mapped IPv6 address to an IPv4 address.
sourcepub fn solicited_node(&self) -> Address
pub fn solicited_node(&self) -> Address
The solicited node for the given unicast address.
Panics
This function panics if the given address is not unicast.
Trait Implementations
sourceimpl From<Address> for Address
impl From<Address> for Address
sourcefn from(addr: Ipv6Address) -> Self
fn from(addr: Ipv6Address) -> Self
Converts to this type from the input type.
sourceimpl FromStr for Ipv6Address
impl FromStr for Ipv6Address
sourcefn from_str(s: &str) -> Result<Ipv6Address, ()>
fn from_str(s: &str) -> Result<Ipv6Address, ()>
Parse a string representation of an IPv6 address.
type Err = ()
type Err = ()
The associated error which can be returned from parsing.
sourceimpl Hash for Address
impl Hash for Address
sourcefn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher]. Read more
1.3.0fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
sourceimpl Ord for Address
impl Ord for Address
sourceimpl PartialOrd<Address> for Address
impl PartialOrd<Address> for Address
sourcefn partial_cmp(&self, other: &Address) -> Option<Ordering>
fn partial_cmp(&self, other: &Address) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0fn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Address
impl Eq for Address
impl StructuralEq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more