Struct smbioslib::UndefinedStructTable
source · pub struct UndefinedStructTable(/* private fields */);
Expand description
§Undefined Struct Table
A collection of UndefinedStruct items.
Implementations§
source§impl<'a> UndefinedStructTable
impl<'a> UndefinedStructTable
sourcepub fn iter(&self) -> Iter<'_, UndefinedStruct>
pub fn iter(&self) -> Iter<'_, UndefinedStruct>
Iterator of the contained UndefinedStruct items.
sourcepub fn defined_struct_iter<T>(&'a self) -> impl Iterator<Item = T> + 'awhere
T: SMBiosStruct<'a>,
pub fn defined_struct_iter<T>(&'a self) -> impl Iterator<Item = T> + 'awhere
T: SMBiosStruct<'a>,
An iterator over the defined type instances within the table.
sourcepub fn all<T, F>(&'a self, f: F) -> bool
pub fn all<T, F>(&'a self, f: F) -> bool
Tests if every element of the defined struct iterator matches a predicate.
sourcepub fn any<T, F>(&'a self, f: F) -> bool
pub fn any<T, F>(&'a self, f: F) -> bool
Tests if any element of the defined struct iterator matches a predicate.
sourcepub fn first<T>(&'a self) -> Option<T>where
T: SMBiosStruct<'a>,
pub fn first<T>(&'a self) -> Option<T>where
T: SMBiosStruct<'a>,
Finds the first occurance of the structure
sourcepub fn find<T, P>(&'a self, predicate: P) -> Option<T>
pub fn find<T, P>(&'a self, predicate: P) -> Option<T>
Finds the first occurance of the structure that satisfies a predicate.
sourcepub fn find_map<A, B, F>(&'a self, f: F) -> Option<B>
pub fn find_map<A, B, F>(&'a self, f: F) -> Option<B>
Applies function to the defined struct elements and returns the first non-none result.
sourcepub fn filter<T, P>(&'a self, predicate: P) -> impl Iterator<Item = T> + 'a
pub fn filter<T, P>(&'a self, predicate: P) -> impl Iterator<Item = T> + 'a
Creates an iterator of the defined structure which uses a closure to determine if an element should be yielded.
sourcepub fn map<A, B, F>(&'a self, f: F) -> impl Iterator<Item = B> + 'awhere
A: SMBiosStruct<'a> + 'a,
F: FnMut(A) -> B + 'a,
pub fn map<A, B, F>(&'a self, f: F) -> impl Iterator<Item = B> + 'awhere
A: SMBiosStruct<'a> + 'a,
F: FnMut(A) -> B + 'a,
Maps the defined struct to another type given by the closure.
sourcepub fn filter_map<A, B, F>(&'a self, f: F) -> impl Iterator<Item = B> + 'a
pub fn filter_map<A, B, F>(&'a self, f: F) -> impl Iterator<Item = B> + 'a
Creates an iterator that both filters and maps from the defined struct iterator.
sourcepub fn find_by_handle(&'a self, handle: &Handle) -> Option<&'a UndefinedStruct>
pub fn find_by_handle(&'a self, handle: &Handle) -> Option<&'a UndefinedStruct>
Finds the structure matching the given handle
To downcast to the defined struct, call .defined_struct() on the result.
sourcepub fn collect<T>(&'a self) -> Vec<T>where
T: SMBiosStruct<'a>,
pub fn collect<T>(&'a self) -> Vec<T>where
T: SMBiosStruct<'a>,
Returns all occurances of the structure
sourcepub fn try_load_from_file_offset(
file: &mut File,
table_offset: u64,
table_len: usize,
) -> Result<Self, Error>
pub fn try_load_from_file_offset( file: &mut File, table_offset: u64, table_len: usize, ) -> Result<Self, Error>
Load an UndefinedStructTable by seeking and reading the file offsets.