get_local_info 0.1.4

Getlocalinfo is a Rust crate that obtains local information
Documentation

get_local_info Crates.io License Documentation

Project Introduction

  • get_local_info is a Rust crate that obtains linux device information,Its goal is to solve the difficulty of obtaining Linux local information.Support Chinese operating systems such as KyLin, UOS, HarmonyOS, etc

    Project maintenance: long-term

Current features:

1.Obtain activity network card information:

  • Netcard
  • IPv4
  • IPv6
  • mac

2.Obtain network interface information

3.Get system version

  • Kylin10 supports 2017 and above
  • Ubuntu supports 18.04 and above
  • UOS20 supports 1020 and above

How to use

1.cargo add get_local_info

2.Import into your project

extern crate get_local_info;

fn main() {
    println!("{}", get_local_info::get_pc_net_card_name());
    println!("{}", get_local_info::get_pc_ipv4());
    println!("{}", get_local_info::get_pc_ipv6());
    println!("{}", get_local_info::get_pc_mac());
    //Obtain network interface information
    println!("{:?}", get_local_info::get_pc_net_card_info());
    //osname:ubuntu or uos or kylin
    let osname = "uos";  
    println!("{}", get_local_info::get_pc_system_ver(osname));
}

About the Author