pub struct Ipv4Interface {
pub name: String,
pub addr: Ipv4Addr,
pub prefix_len: u8,
pub broadcast: Option<Ipv4Addr>,
pub ifindex: u32,
pub is_up: bool,
pub is_loopback: bool,
pub supports_multicast: bool,
}Expand description
One local IPv4 interface address.
Fields§
§name: StringOperating system name of the interface, or an index label on Windows.
addr: Ipv4AddrLocal IPv4 address.
prefix_len: u8Subnet prefix length (0 to 32).
broadcast: Option<Ipv4Addr>Directed subnet broadcast address, when the prefix is below 31.
ifindex: u32Interface index.
is_up: boolTrue when the interface is up.
is_loopback: boolTrue when the interface is loopback.
supports_multicast: boolTrue when the interface supports multicast.
Implementations§
Source§impl Ipv4Interface
impl Ipv4Interface
Sourcepub fn subnet_peers(&self) -> Vec<Ipv4Addr>
pub fn subnet_peers(&self) -> Vec<Ipv4Addr>
Host addresses in this subnet, excluding network, broadcast, and self.
Returns an empty list for loopback, down interfaces, or subnets larger
than /24 (prefix_len < 24). A corporate /16 is never swept.
Trait Implementations§
Source§impl Clone for Ipv4Interface
impl Clone for Ipv4Interface
Source§impl Debug for Ipv4Interface
impl Debug for Ipv4Interface
impl Eq for Ipv4Interface
Source§impl PartialEq for Ipv4Interface
impl PartialEq for Ipv4Interface
impl StructuralPartialEq for Ipv4Interface
Auto Trait Implementations§
impl Forget for Ipv4Interface
impl Freeze for Ipv4Interface
impl Move for Ipv4Interface
impl RefUnwindSafe for Ipv4Interface
impl Send for Ipv4Interface
impl Sync for Ipv4Interface
impl Unpin for Ipv4Interface
impl UnsafeUnpin for Ipv4Interface
impl UnwindSafe for Ipv4Interface
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