Struct dmidecode::RawStructure
source · [−]pub struct RawStructure<'buffer> {
pub version: SmbiosVersion,
pub info: InfoType,
pub length: u8,
pub handle: u16,
pub data: &'buffer [u8],
/* private fields */
}Expand description
The raw SMBIOS structure information for structures that are not handled by this crate, such as Oem structures.
Fields
version: SmbiosVersioninfo: InfoTypelength: u8handle: u16data: &'buffer [u8]Implementations
Find a string in the strings table by the string index. If the string index is 0, the empty string is returned. Otherwise, the string corresponding to that string index in the strings table is returned.
Errors
Returns a MalformedStructureError::InvalidStringIndex if the index is outside of the strings table.
pub fn get<T: TryFromBytes<'buffer, T>>(
&self,
offset: usize
) -> Result<T, MalformedStructureError>
pub fn get<T: TryFromBytes<'buffer, T>>(
&self,
offset: usize
) -> Result<T, MalformedStructureError>
Get value by offset declared in SMBIOS Reference Specification.
Type meaning data length is mandatory:
- BYTE: u8
- WORD: u16
- DWORD: u32
- QWORD: u64
The only error this method returned: MalformedStructureError::InvalidSlice (actually is core::array::TryFromSliceError). If getting value index exceedes length of Formatted section it may be ignored to return None value of structure field. In this case Formatted section length automatically hide non-existing values
Wrapper to self.data.get(..) with header offset correction
Get STRING by offset declared in SMBIOS Reference Specification
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl<'buffer> RefUnwindSafe for RawStructure<'buffer>
impl<'buffer> Send for RawStructure<'buffer>
impl<'buffer> Sync for RawStructure<'buffer>
impl<'buffer> Unpin for RawStructure<'buffer>
impl<'buffer> UnwindSafe for RawStructure<'buffer>
Blanket Implementations
Mutably borrows from an owned value. Read more