Struct smbioslib::SMBiosData[][src]

pub struct SMBiosData {
    pub version: Option<SMBiosVersion>,
    // some fields omitted
}

SMBIOS Data

Contains an optional SMBIOS version and a collection of SMBIOS structures.

Fields

version: Option<SMBiosVersion>

Version of the contained SMBIOS structures.

Implementations

impl<'a> SMBiosData[src]

pub fn new(table: UndefinedStructTable, version: Option<SMBiosVersion>) -> Self[src]

Creates an SMBIOS table parser which can be iterated

table is iterable table data. version is optional and represents the DMTF SMBIOS Standard version of the bytes in data.

pub fn from_vec_and_version(
    data: Vec<u8>,
    version: Option<SMBiosVersion>
) -> Self
[src]

Creates an SMBIOS table parser which can be iterated

data is a block of bytes representing the raw table data. version is optional and represents the DMTF SMBIOS Standard version of the bytes in data.

pub fn try_load_from_file(
    filename: &str,
    version: Option<SMBiosVersion>
) -> Result<SMBiosData, Error>
[src]

Loads raw SMBios table data from a file

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

Iterator of the contained UndefinedStruct items

pub fn defined_struct_iter<T: 'a>(&'a self) -> impl Iterator<Item = T> + 'a where
    T: SMBiosStruct<'a>, 
[src]

An iterator over the defined type instances within the table.

pub fn all<T, F>(&'a self, f: F) -> bool where
    T: SMBiosStruct<'a>,
    F: FnMut(T) -> bool
[src]

Tests if every element of the defined struct iterator matches a predicate.

pub fn any<T, F>(&'a self, f: F) -> bool where
    T: SMBiosStruct<'a>,
    F: FnMut(T) -> bool
[src]

Tests if any element of the defined struct iterator matches a predicate.

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

Finds the first occurance of the structure

pub fn find<T, P>(&'a self, predicate: P) -> Option<T> where
    T: SMBiosStruct<'a>,
    P: FnMut(&T) -> bool
[src]

Finds the first occurance of the structure that satisfies a predicate.

pub fn find_map<A, B, F>(&'a self, f: F) -> Option<B> where
    A: SMBiosStruct<'a>,
    F: FnMut(A) -> Option<B>, 
[src]

Applies function to the defined struct elements and returns the first non-none result.

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

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

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

Takes a closure and creates an iterator which calls that closure on each defined struct.

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

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

pub fn find_by_handle(&'a self, handle: &Handle) -> Option<&UndefinedStruct>[src]

Finds the structure matching the given handle

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>, 
[src]

Finds all occurances of the structure

Trait Implementations

impl Debug for SMBiosData[src]

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

Formats the value using the given formatter. Read more

impl IntoIterator for SMBiosData[src]

type Item = UndefinedStruct

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Creates an iterator from a value. Read more

impl Serialize for SMBiosData[src]

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T

Notable traits for &'_ mut R

impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.