Struct smbioslib::UndefinedStructTable
source · [−]pub struct UndefinedStructTable(_);
Expand description
Undefined Struct Table
A collection of UndefinedStruct items.
Implementations
sourceimpl<'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> + 'a where
T: SMBiosStruct<'a>,
pub fn defined_struct_iter<T>(&'a self) -> impl Iterator<Item = T> + 'a where
T: SMBiosStruct<'a>,
An iterator over the defined type instances within the table.
sourcepub fn all<T, F>(&'a self, f: F) -> bool where
T: SMBiosStruct<'a>,
F: FnMut(T) -> bool,
pub fn all<T, F>(&'a self, f: F) -> bool where
T: SMBiosStruct<'a>,
F: FnMut(T) -> bool,
Tests if every element of the defined struct iterator matches a predicate.
sourcepub fn any<T, F>(&'a self, f: F) -> bool where
T: SMBiosStruct<'a>,
F: FnMut(T) -> bool,
pub fn any<T, F>(&'a self, f: F) -> bool where
T: SMBiosStruct<'a>,
F: FnMut(T) -> 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> where
T: SMBiosStruct<'a>,
P: FnMut(&T) -> bool,
pub fn find<T, P>(&'a self, predicate: P) -> Option<T> where
T: SMBiosStruct<'a>,
P: FnMut(&T) -> bool,
Finds the first occurance of the structure that satisfies a predicate.
sourcepub fn find_map<A, B, F>(&'a self, f: F) -> Option<B> where
A: SMBiosStruct<'a>,
F: FnMut(A) -> Option<B>,
pub fn find_map<A, B, F>(&'a self, f: F) -> Option<B> where
A: SMBiosStruct<'a>,
F: FnMut(A) -> Option<B>,
Applies function to the defined struct elements and returns the first non-none result.
sourcepub fn filter<T: 'a, P: 'a>(
&'a self,
predicate: P
) -> impl Iterator<Item = T> + 'a where
T: SMBiosStruct<'a>,
P: FnMut(&T) -> bool,
pub fn filter<T: 'a, P: 'a>(
&'a self,
predicate: P
) -> impl Iterator<Item = T> + 'a where
T: SMBiosStruct<'a>,
P: FnMut(&T) -> bool,
Creates an iterator of the defined structure which uses a closure to determine if an element should be yielded.
sourcepub fn map<A: 'a, B, F: 'a>(&'a self, f: F) -> impl Iterator<Item = B> + 'a where
A: SMBiosStruct<'a>,
F: FnMut(A) -> B,
pub fn map<A: 'a, B, F: 'a>(&'a self, f: F) -> impl Iterator<Item = B> + 'a where
A: SMBiosStruct<'a>,
F: FnMut(A) -> B,
Maps the defined struct to another type given by the closure.
sourcepub fn filter_map<A: 'a, B, F: 'a>(
&'a self,
f: F
) -> impl Iterator<Item = B> + 'a where
A: SMBiosStruct<'a>,
F: FnMut(A) -> Option<B>,
pub fn filter_map<A: 'a, B, F: 'a>(
&'a self,
f: F
) -> impl Iterator<Item = B> + 'a where
A: SMBiosStruct<'a>,
F: FnMut(A) -> Option<B>,
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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
T: SMBiosStruct<'a>,
pub fn collect<T>(&'a self) -> Vec<T>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
where
T: SMBiosStruct<'a>,
A: Allocator,
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.
Trait Implementations
sourceimpl Debug for UndefinedStructTable
impl Debug for UndefinedStructTable
sourceimpl IntoIterator for UndefinedStructTable
impl IntoIterator for UndefinedStructTable
sourceimpl Serialize for UndefinedStructTable
impl Serialize for UndefinedStructTable
Auto Trait Implementations
impl RefUnwindSafe for UndefinedStructTable
impl Send for UndefinedStructTable
impl Sync for UndefinedStructTable
impl Unpin for UndefinedStructTable
impl UnwindSafe for UndefinedStructTable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more