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 )
모든 수정 또는 개선으로 자유롭게 기여하십시오.
화물을 사용하여 테스트를 Rus 할 수 있습니다
cargo test 그의 지원을 위해 Xmonader에게.