#[repr(transparent)]pub struct Address {
inner: ipv6_addr_t,
}
riot_module_ipv6
only.Expand description
An IPv6 address
This is strictly equivalent and convertible with a core::net::Ipv6Addr, but can not be guaranteed the same memory layout (mostly alignment).
Method implementations mixedly use what RIOT offers and what Rust’s standard library offers, depending on what is easiest to use, trusting that the compiler will elide the memory copying that is required for conversion in case the copy is not necessary for alignment purposes.
Fields§
§inner: ipv6_addr_t
Implementations§
Source§impl Address
impl Address
pub fn raw(&self) -> &[u8; 16]
pub unsafe fn as_ptr(&self) -> *const ipv6_addr_t
Sourcepub fn clone_from_ptr(raw: *const ipv6_addr_t) -> Self
pub fn clone_from_ptr(raw: *const ipv6_addr_t) -> Self
Given a ipv6_addr_t, copy the data out into an Address.
That might be inefficient in many cases, and there might be a way to get an &Address newtyped from a &ipv6_addr_t, but right now this was simple to do.
pub fn is_unspecified(&self) -> bool
pub fn is_loopback(&self) -> bool
pub fn is_multicast(&self) -> bool
pub fn is_link_local(&self) -> bool
Trait Implementations§
impl Copy for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoSwitch for T
impl<T> IntoSwitch for T
Source§fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
Source§fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes