Struct smbioslib::UndefinedStructTable

source ·
pub struct UndefinedStructTable(/* private fields */);
Expand description

§Undefined Struct Table

A collection of UndefinedStruct items.

Implementations§

source§

impl<'a> UndefinedStructTable

source

pub fn iter(&self) -> Iter<'_, UndefinedStruct>

Iterator of the contained UndefinedStruct items.

source

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.

source

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.

source

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.

source

pub fn first<T>(&'a self) -> Option<T>
where T: SMBiosStruct<'a>,

Finds the first occurance of the structure

source

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.

source

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.

source

pub fn filter<T, P>(&'a self, predicate: P) -> impl Iterator<Item = T> + 'a
where T: SMBiosStruct<'a> + 'a, P: FnMut(&T) -> bool + 'a,

Creates an iterator of the defined structure which uses a closure to determine if an element should be yielded.

source

pub fn map<A, B, F>(&'a self, f: F) -> impl Iterator<Item = B> + 'a
where A: SMBiosStruct<'a> + 'a, F: FnMut(A) -> B + 'a,

Maps the defined struct to another type given by the closure.

source

pub fn filter_map<A, B, F>(&'a self, f: F) -> impl Iterator<Item = B> + 'a
where A: SMBiosStruct<'a> + 'a, F: FnMut(A) -> Option<B> + 'a,

Creates an iterator that both filters and maps from the defined struct iterator.

source

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.

source

pub fn collect<T>(&'a self) -> Vec<T>
where T: SMBiosStruct<'a>,

Returns all occurances of the structure

source

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§

source§

impl Debug for UndefinedStructTable

source§

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

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

impl From<Vec<u8>> for UndefinedStructTable

source§

fn from(data: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl IntoIterator for UndefinedStructTable

source§

type Item = UndefinedStruct

The type of the elements being iterated over.
source§

type IntoIter = IntoIter<<UndefinedStructTable as IntoIterator>::Item>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl Serialize for UndefinedStructTable

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.