dmidecoder
1.0.0
将DMIDECODE输出转换为正确形成的数据(HashMap)
将DmideCoder解析器添加到您的依赖项中
dmidecoder = { git = " https://github.com/andrewayoub/dmidecoder.git " }作为外部板条箱进口
extern crate dmidecoder ;
use dmidecoder :: dmidecoder :: parse ;将DMideCoder原始数据传递到解析方法
let sample = r#"
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: LENOVO
Version: 9BCN26WW
Release Date: 07/31/2014
Address: 0xE0000
Runtime Size: 128 kB
ROM Size: 4096 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
5.25"/360 kB floppy services are supported (int 13h)
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 kB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
8042 keyboard services are supported (int 9h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Targeted content distribution is supported
UEFI is supported
BIOS Revision: 0.26
Firmware Revision: 0.26
Handle 0x0010, DMI type 13, 22 bytes
BIOS Language Information
Language Description Format: Long
Installable Languages: 4
en|US|iso8859-1
fr|CA|iso8859-1
ja|JP|unicode
zh|TW|unicode
Currently Installed Language: en|US|iso8859-1
"# ;
let sections = parse ( sample ) ;
println ! ( "{:?}" , sections [ "BIOS Information" ] . properties [ "Characteristics" ] . items )
随时通过任何修改或改进做出贡献。
您可以使用货物进行测试
cargo test 致Xmonader的支持。