Struct Bios

Source
pub struct Bios { /* private fields */ }

Implementations§

Source§

impl Bios

Source

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}
Source

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}
Source

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§

Source§

impl Debug for Bios

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Bios

Source§

fn eq(&self, other: &Bios) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Bios

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.