pub enum IpAddress {
Ipv4(Ipv4Address),
}
Expand description
An internetworking address.
Variants§
Ipv4(Ipv4Address)
An IPv4 address.
Implementations§
Source§impl Address
impl Address
Sourcepub const fn v4(a0: u8, a1: u8, a2: u8, a3: u8) -> Address
pub const fn v4(a0: u8, a1: u8, a2: u8, a3: u8) -> Address
Create an address wrapping an IPv4 address with the given octets.
Sourcepub const fn as_bytes(&self) -> &[u8]
pub const fn as_bytes(&self) -> &[u8]
Return an 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 a valid unicast address.
Sourcepub const fn is_multicast(&self) -> bool
pub const fn is_multicast(&self) -> bool
Query whether the address is a valid multicast address.
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Query whether the address is the broadcast address.
Sourcepub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Query whether the address falls into the “unspecified” range.
Sourcepub fn prefix_len(&self) -> Option<u8>
pub fn prefix_len(&self) -> Option<u8>
If self
is a CIDR-compatible subnet mask, return Some(prefix_len)
,
where prefix_len
is the number of leading zeroes. Return None
otherwise.
Trait Implementations§
Source§impl From<Address> for Address
impl From<Address> for Address
Source§fn from(addr: Ipv4Address) -> Self
fn from(addr: Ipv4Address) -> Self
Converts to this type from the input type.
Source§impl Ord for Address
impl Ord for Address
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq 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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
)