systemconfiguration-rs 0.2.1

Safe Rust bindings for Apple's SystemConfiguration framework via a Swift bridge on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use systemconfiguration::NetworkInterface;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    for interface in NetworkInterface::copy_all()? {
        println!(
            "bsd={:?} type={:?} name={:?}",
            interface.bsd_name()?,
            interface.interface_type()?,
            interface.localized_display_name()?
        );
    }
    Ok(())
}