pub struct NetifAddress(/* private fields */);
Expand description
Data type representing IPv6 address from a network interface.
Functional equivalent of otsys::otNetifAddress
.
Implementations§
Source§impl NetifAddress
impl NetifAddress
Sourcepub fn new(addr: Ipv6Addr, prefix_len: u8) -> NetifAddress
pub fn new(addr: Ipv6Addr, prefix_len: u8) -> NetifAddress
Creates a new instance from an Ipv6 address and prefix length.
The resulting instance will have the valid
and preferred
bits set.
Sourcepub fn addr(&self) -> &Ip6Address
pub fn addr(&self) -> &Ip6Address
Returns a reference to the IPv6 address.
Sourcepub fn prefix_len(&self) -> u8
pub fn prefix_len(&self) -> u8
Returns the prefix length for this address.
Sourcepub fn address_origin(&self) -> AddressOrigin
pub fn address_origin(&self) -> AddressOrigin
Returns the address origin for this address.
Sourcepub fn is_preferred(&self) -> bool
pub fn is_preferred(&self) -> bool
Returns true if this address is preferred.
Sourcepub fn set_preferred(&mut self, x: bool)
pub fn set_preferred(&mut self, x: bool)
Sets the preferred
bit on this address.
Trait Implementations§
Source§impl Clone for NetifAddress
impl Clone for NetifAddress
Source§fn clone(&self) -> NetifAddress
fn clone(&self) -> NetifAddress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NetifAddress
impl Debug for NetifAddress
Source§impl Default for NetifAddress
impl Default for NetifAddress
Source§fn default() -> NetifAddress
fn default() -> NetifAddress
Returns the “default value” for a type. Read more
Source§impl Display for NetifAddress
impl Display for NetifAddress
Source§impl<'a> From<&'a NetifAddress> for &'a otNetifAddress
impl<'a> From<&'a NetifAddress> for &'a otNetifAddress
Source§fn from(x: &'a NetifAddress) -> Self
fn from(x: &'a NetifAddress) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a otNetifAddress> for &'a NetifAddress
impl<'a> From<&'a otNetifAddress> for &'a NetifAddress
Source§impl From<NetifAddress> for otNetifAddress
impl From<NetifAddress> for otNetifAddress
Source§fn from(x: NetifAddress) -> Self
fn from(x: NetifAddress) -> Self
Converts to this type from the input type.
Source§impl From<otNetifAddress> for NetifAddress
impl From<otNetifAddress> for NetifAddress
Source§impl OtCastable for NetifAddress
impl OtCastable for NetifAddress
Source§fn as_ot_ptr(&self) -> *const Self::OtType
fn as_ot_ptr(&self) -> *const Self::OtType
Returns a pointer to the underlying
Self::OtType
instance.Source§fn as_ot_mut_ptr(&mut self) -> *mut Self::OtType
fn as_ot_mut_ptr(&mut self) -> *mut Self::OtType
Returns a mutable pointer to the underlying
Self::OtType
instance.Source§unsafe fn ref_from_ot_ptr<'a>(ptr: *const Self::OtType) -> Option<&'a Self>
unsafe fn ref_from_ot_ptr<'a>(ptr: *const Self::OtType) -> Option<&'a Self>
Creates a reference from a pointer to an
Self::OtType
. Read moreSource§unsafe fn mut_from_ot_mut_ptr<'a>(
ptr: *mut Self::OtType,
) -> Option<&'a mut Self>
unsafe fn mut_from_ot_mut_ptr<'a>( ptr: *mut Self::OtType, ) -> Option<&'a mut Self>
Creates a mut reference from a mut pointer to an
Self::OtType
. Read moreSource§fn as_ot_ref(&self) -> &Self::OtType
fn as_ot_ref(&self) -> &Self::OtType
Returns a reference to the original OpenThread type
Self::OtType
.Source§fn as_ot_mut(&mut self) -> &mut Self::OtType
fn as_ot_mut(&mut self) -> &mut Self::OtType
Returns a mutable reference to the original OpenThread type
Self::OtType
.Source§fn ref_from_ot_ref(x: &Self::OtType) -> &Self
fn ref_from_ot_ref(x: &Self::OtType) -> &Self
Casts a reference to the original OpenThread type to a reference to
Self
.Source§impl Transparent for NetifAddress
impl Transparent for NetifAddress
impl Copy for NetifAddress
Auto Trait Implementations§
impl Freeze for NetifAddress
impl RefUnwindSafe for NetifAddress
impl !Send for NetifAddress
impl !Sync for NetifAddress
impl Unpin for NetifAddress
impl UnwindSafe for NetifAddress
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
)