Enum dmidecode::EntryPoint
source · pub enum EntryPoint {
V2(EntryPointV2),
V3(EntryPointV3),
}Variants§
V2(EntryPointV2)
V3(EntryPointV3)
Implementations§
source§impl EntryPoint
impl EntryPoint
pub fn len(&self) -> u8
pub fn major(&self) -> u8
pub fn minor(&self) -> u8
pub fn revision(&self) -> u8
pub fn smbios_address(&self) -> u64
pub fn smbios_len(&self) -> u32
pub fn to_version(&self) -> SmbiosVersion
sourcepub fn structures<'buffer>(&self, buffer: &'buffer [u8]) -> Structures<'buffer> ⓘ
pub fn structures<'buffer>(&self, buffer: &'buffer [u8]) -> Structures<'buffer> ⓘ
Create an iterator across the SMBIOS structures found in buffer.
Example
use dmidecode::EntryPoint;
const DMIDECODE_BIN: &'static [u8] = include_bytes!("../tests/data/dmidecode.bin");
let entry_point = EntryPoint::search(DMIDECODE_BIN)?;
for s in entry_point.structures(&DMIDECODE_BIN[entry_point.smbios_address() as usize..]) {
let table = s?;
}
Ok(())sourcepub fn search(buffer: &[u8]) -> Result<EntryPoint, InvalidEntryPointError>
pub fn search(buffer: &[u8]) -> Result<EntryPoint, InvalidEntryPointError>
Search for an instance of an SMBIOS EntryPoint in a memory buffer.
Example
use dmidecode::EntryPoint;
const ENTRY_BIN: &'static [u8] = include_bytes!("../tests/data/entry.bin");
let entry_point = EntryPoint::search(ENTRY_BIN);Errors
If this function fails to find a valid SMBIOS EntryPoint, it will return
an InvalidEntryPointError variant.
Auto Trait Implementations§
impl RefUnwindSafe for EntryPoint
impl Send for EntryPoint
impl Sync for EntryPoint
impl Unpin for EntryPoint
impl UnwindSafe for EntryPoint
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