Struct WinSMBiosData

Source
pub struct WinSMBiosData {
    pub smbios_data: SMBiosData,
    /* private fields */
}
Expand description

§Raw SMBIOS Data

When Windows kernel32 GetSystemFirmwareTable function is called for RSMB, the raw SMBIOS table provider (‘RSMB’) it retrieves the contents of this raw SMBIOS firmware table structure.

Fields§

§smbios_data: SMBiosData

SMBios table data

Implementations§

Source§

impl WinSMBiosData

Source

pub const USED20_CALLING_METHOD_OFFSET: usize = 0usize

Offset of the Used20CallingMethod field (0)

Source

pub const SMBIOS_MAJOR_VERSION_OFFSET: usize = 1usize

Offset of the SMBIOSMajorVersion field (1)

Source

pub const SMBIOS_MINOR_VERSION_OFFSET: usize = 2usize

Offset of the SMBIOSMinorVersion field (2)

Source

pub const DMI_REVISION_OFFSET: usize = 3usize

Offset of the DMIRevision field (3)

Source

pub const TABLE_DATA_LENGTH_OFFSET: usize = 4usize

Offset of the Length field (4)

Source

pub const SMBIOS_TABLE_DATA_OFFSET: usize = 8usize

Offset of the SMBIOSTableData field (8)

Source

pub fn new(raw_smbios_data: Vec<u8>) -> Result<WinSMBiosData, Error>

Creates an instance of WinSMBiosData

To retrieve this structure on a windows system call load_windows_smbios_data().

The new() is provided publicly to allow loading data from other sources such as a file or from memory array as is done with testing.

Source

pub fn is_valid_win_smbios_data(raw_data: &Vec<u8>) -> bool

Verify if a block of data is a valid WinSMBiosData structure

This only checks if the structure itself is valid and not whether the contained SMBiosData structure is valid or not.

Source

pub fn raw_smbios_data(&self) -> &[u8]

The raw SMBIOS data this structure is wrapping

Source

pub fn used20_calling_method(&self) -> u8

Used20CallingMethod

Source

pub fn smbios_major_version(&self) -> u8

SMBIOS major version

Source

pub fn smbios_minor_version(&self) -> u8

SMBIOS minor version

Source

pub fn dmi_revision(&self) -> u8

DMI revision

Source

pub fn table_data_length(&self) -> u32

Length of the smbios table data

Trait Implementations§

Source§

impl Debug for WinSMBiosData

Source§

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

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

impl Serialize for WinSMBiosData

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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.