今天收到西安城市开发者社区的文章收录通知,谢谢社区的肯定。
随即发布0.2.3版本,增加峰值算法。
get_local_info是一个获取linux本地信息的Rust三方库,其目标是降低获取本地linux系统信息的难度。支持银河麒麟10、UOS、鸿蒙等国产系统。
项目维护:长期
当前功能:
1.网络功能
1.1.获取网络接口信息
1.2 获取活动网卡信息:网卡,IPv4,IPv6,mac,外网IPv4地址,根据域名解析出IP地址
2.获取系统版本
Kylin10支持2017及以上版本
Ubuntu支持22.04及以上版本
UOS20支持1020及以上版本
3.进程检测,虚拟机检测,双系统检测
4.信息安全检测
获取天融信反病毒库时间
5.文件信息
得到指定目录下所有文件名
额外功能:
寻找峰值算法
怎么使用:
执行cargo add get_local_info,然后导入调用接口:
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());
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));
//check proccess name
let pname = "gnome";
println!("{}", get_local_info::get_pc_system_check_pname(pname));
// flase is Real machine, true is vm
println!("Running in VM:{}", get_local_info::get_pc_system_is_vm());
// true is multi os
println!("multi os:{}", get_local_info::get_pc_system_is_d_sys());
// Obtain the update time of the antivirus database
let antiname = "topsec";
println!("{}", get_local_info::get_pc_check_antiviruslib(antiname));
//Traverse all files in the specified directory
let idir = "/opt";
println!("{:?}", get_local_info::get_dir_filename(idir));
let uri = "https://api.ipify.org/?format=text";
println!("{}", get_local_info::network::get_ww_ipv4(uri));
let hostname = "www.baidu.com";
let parse_ip = get_local_info::network::get_domain_ip(hostname);
println!("domain parse_ip:{:?}",parse_ip);
let nums = [3,5,12,45,4,9];
println!("{}", get_local_info::alg::find_peak_element(nums.to_vec()));
}
# About the Author
* Liu Qiang in Wuhan, China
* crates: <https://crates.io/crates/get_local_info>
* github: <https://github.com/daijianshusheng/rs_libGetDeviceInfo>
* mail: <liulcsy@qq.com>文章来源:https://www.toymoban.com/news/detail-792476.html
* Created on 2023.12.28文章来源地址https://www.toymoban.com/news/detail-792476.html
到了这里,关于[我的Rust库更新]get_local_info 0.2.3的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!