pub struct Bios { /* private fields */ }
Implementations§
Source§impl Bios
impl Bios
Sourcepub fn read() -> Result<Self>
pub fn read() -> Result<Self>
Examples found in repository?
examples/dmidecode_mini.rs (line 9)
7fn main() {
8
9 let bios = Bios::read().expect("failed to read bios info");
10 let bios_info = bios.bios_info().expect("failed to get bios info");
11 let system_info = bios.system_info().expect("failed to get system info");
12
13 println!("Bios Information");
14 println!("\tVendor: {}", bios_info.vendor);
15 println!("\tVersion: {}", bios_info.version);
16 println!("\tRelease Date: {}", bios_info.release_date);
17 println!("\tBIOS Revision: {}.{}", bios_info.major, bios_info.minor);
18 println!();
19
20 println!("System Information");
21 println!("\tManufacturer: {}", system_info.manufacturer);
22 println!("\tProduct Name: {}", system_info.product_name);
23 println!("\tVersion: {}", system_info.version);
24 println!("\tSerial Number: {}", system_info.serial_number);
25 println!("\tUUID: {}", system_info.uuid);
26 println!("\tSKU Number: {}", system_info.sku_number);
27 println!("\tFamily: {}", system_info.family);
28
29}
Sourcepub fn bios_info(&self) -> Option<BiosInfo<'_>>
pub fn bios_info(&self) -> Option<BiosInfo<'_>>
Examples found in repository?
examples/dmidecode_mini.rs (line 10)
7fn main() {
8
9 let bios = Bios::read().expect("failed to read bios info");
10 let bios_info = bios.bios_info().expect("failed to get bios info");
11 let system_info = bios.system_info().expect("failed to get system info");
12
13 println!("Bios Information");
14 println!("\tVendor: {}", bios_info.vendor);
15 println!("\tVersion: {}", bios_info.version);
16 println!("\tRelease Date: {}", bios_info.release_date);
17 println!("\tBIOS Revision: {}.{}", bios_info.major, bios_info.minor);
18 println!();
19
20 println!("System Information");
21 println!("\tManufacturer: {}", system_info.manufacturer);
22 println!("\tProduct Name: {}", system_info.product_name);
23 println!("\tVersion: {}", system_info.version);
24 println!("\tSerial Number: {}", system_info.serial_number);
25 println!("\tUUID: {}", system_info.uuid);
26 println!("\tSKU Number: {}", system_info.sku_number);
27 println!("\tFamily: {}", system_info.family);
28
29}
Sourcepub fn system_info(&self) -> Option<SystemInfo<'_>>
pub fn system_info(&self) -> Option<SystemInfo<'_>>
Examples found in repository?
examples/dmidecode_mini.rs (line 11)
7fn main() {
8
9 let bios = Bios::read().expect("failed to read bios info");
10 let bios_info = bios.bios_info().expect("failed to get bios info");
11 let system_info = bios.system_info().expect("failed to get system info");
12
13 println!("Bios Information");
14 println!("\tVendor: {}", bios_info.vendor);
15 println!("\tVersion: {}", bios_info.version);
16 println!("\tRelease Date: {}", bios_info.release_date);
17 println!("\tBIOS Revision: {}.{}", bios_info.major, bios_info.minor);
18 println!();
19
20 println!("System Information");
21 println!("\tManufacturer: {}", system_info.manufacturer);
22 println!("\tProduct Name: {}", system_info.product_name);
23 println!("\tVersion: {}", system_info.version);
24 println!("\tSerial Number: {}", system_info.serial_number);
25 println!("\tUUID: {}", system_info.uuid);
26 println!("\tSKU Number: {}", system_info.sku_number);
27 println!("\tFamily: {}", system_info.family);
28
29}
Trait Implementations§
impl Eq for Bios
impl StructuralPartialEq for Bios
Auto Trait Implementations§
impl Freeze for Bios
impl RefUnwindSafe for Bios
impl Send for Bios
impl Sync for Bios
impl Unpin for Bios
impl UnwindSafe for Bios
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more