Struct smoltcp::wire::Ipv4Address
source · [−]Expand description
A four-octet IPv4 address.
Tuple Fields
0: [u8; 4]
Implementations
sourceimpl Address
impl Address
sourcepub const UNSPECIFIED: Address = Address([0x00; 4])
pub const UNSPECIFIED: Address = Address([0x00; 4])
An unspecified address.
sourcepub const MULTICAST_ALL_SYSTEMS: Address = Address([224, 0, 0, 1])
pub const MULTICAST_ALL_SYSTEMS: Address = Address([224, 0, 0, 1])
All multicast-capable nodes
sourcepub const MULTICAST_ALL_ROUTERS: Address = Address([224, 0, 0, 2])
pub const MULTICAST_ALL_ROUTERS: Address = Address([224, 0, 0, 2])
All multicast-capable routers
sourcepub const fn new(a0: u8, a1: u8, a2: u8, a3: u8) -> Address
pub const fn new(a0: u8, a1: u8, a2: u8, a3: u8) -> Address
Construct an IPv4 address from parts.
sourcepub fn from_bytes(data: &[u8]) -> Address
pub fn from_bytes(data: &[u8]) -> Address
Construct an IPv4 address from a sequence of octets, in big-endian.
Panics
The function panics if data
is not four octets long.
sourcepub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Return an IPv4 address as a sequence of octets, in big-endian.
sourcepub fn is_unicast(&self) -> bool
pub fn is_unicast(&self) -> bool
Query whether the address is an unicast address.
sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Query whether the address is the broadcast address.
sourcepub const fn is_multicast(&self) -> bool
pub const fn is_multicast(&self) -> bool
Query whether the address is a multicast address.
sourcepub const fn is_unspecified(&self) -> bool
pub const fn is_unspecified(&self) -> bool
Query whether the address falls into the “unspecified” range.
sourcepub fn is_link_local(&self) -> bool
pub fn is_link_local(&self) -> bool
Query whether the address falls into the “link-local” range.
sourcepub const fn is_loopback(&self) -> bool
pub const fn is_loopback(&self) -> bool
Query whether the address falls into the “loopback” range.
Trait Implementations
sourceimpl From<Address> for Address
impl From<Address> for Address
sourcefn from(addr: Ipv4Address) -> Self
fn from(addr: Ipv4Address) -> Self
Converts to this type from the input type.
sourceimpl FromStr for Ipv4Address
impl FromStr for Ipv4Address
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.0 · sourcefn 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.0 · sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<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.
sourcefn 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