pub struct Motherboard { /* private fields */ }
Expand description
This type allows to retrieve motherboard-related information.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("{m:?}");
}
Implementations§
Source§impl Motherboard
impl Motherboard
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Creates a new instance of the Motherboard
type.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("{m:?}");
}
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
Returns the motherboard name.
This corresponds to the model identifier assigned by the motherboard’s manufacturer (e.g. “20BE0061MC”). This information isn’t available on ARM-based macOS systems.
Important: this information is computed every time this function is called.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("Motherboard name: {:?}", m.name());
}
Sourcepub fn vendor_name(&self) -> Option<String>
pub fn vendor_name(&self) -> Option<String>
Returns the motherboard vendor name.
This corresponds to the name of the motherboard’s manufacturer (e.g. “LENOVO”).
Important: this information is computed every time this function is called.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("Motherboard vendor: {:?}", m.vendor_name());
}
Sourcepub fn version(&self) -> Option<String>
pub fn version(&self) -> Option<String>
Returns the motherboard version.
This corresponds to the version or model number assigned by the motherboard’s manufacturer (e.g. “0B98401 Pro”). This information isn’t available on ARM-based macOS systems.
Important: this information is computed every time this function is called.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("Motherboard version: {:?}", m.version());
}
Sourcepub fn serial_number(&self) -> Option<String>
pub fn serial_number(&self) -> Option<String>
Returns the motherboard serial number.
This corresponds to the serial number assigned by the motherboard’s manufacturer (e.g. “W1KS427111E”).
Important: this information is computed every time this function is called.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("Motherboard serial number: {:?}", m.serial_number());
}
Sourcepub fn asset_tag(&self) -> Option<String>
pub fn asset_tag(&self) -> Option<String>
Returns the motherboard asset tag.
This corresponds to the identifier assigned by the motherboard’s manufacturer to track the physical device for inventory purposes.
Important: this information is computed every time this function is called.
⚠️ Not supported on macOS/iOS.
use sysinfo::Motherboard;
if let Some(m) = Motherboard::new() {
println!("Motherboard asset tag: {:?}", m.asset_tag());
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Motherboard
impl RefUnwindSafe for Motherboard
impl Send for Motherboard
impl Sync for Motherboard
impl Unpin for Motherboard
impl UnwindSafe for Motherboard
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes