Struct TypeReader

Source
pub struct TypeReader {
    pub files: Vec<WinmdFile>,
    pub types: BTreeMap<String, BTreeMap<String, TypeDef>>,
}
Expand description

A reader of type information from Windows Metadata

Fields§

§files: Vec<WinmdFile>

The parsed Windows metadata files the TypeReader has access to

§types: BTreeMap<String, BTreeMap<String, TypeDef>>

Types known to this TypeReader

This is a mapping between namespace names and the types inside that namespace

Implementations§

Source§

impl TypeReader

Source

pub fn from_os() -> Self

Source

pub fn new(files: Vec<WinmdFile>) -> Self

Create a new TypeReader from a WinmdFiles

Source

pub fn namespaces(&self) -> impl Iterator<Item = &String>

Get all the namespace names that the TypeReader knows about

Source

pub fn namespace_types( &self, namespace: &str, ) -> impl Iterator<Item = (&str, &TypeDef)>

Get all type definitions ([TypeDef]s) for a given namespace

§Panics

Panics if the namespace does not exist

Source

pub fn resolve_type_def(&self, (namespace, type_name): (&str, &str)) -> TypeDef

Resolve a type definition given its namespace and type name

§Panics

Panics if no type definition for the given namespace and type name can be found

Source

pub fn u32(&self, row: Row, column: u32) -> u32

Read a u32 value from a specific [Row] and column

Source

pub fn str(&self, row: Row, column: u32) -> &str

Read a &str value from a specific [Row] and column

Source

pub fn decode<T: Decode>(&self, row: Row, column: u32) -> T

Read a T: Decode value from a specific [Row] and column

Source

pub fn list( &self, row: Row, table: TableIndex, column: u32, ) -> impl Iterator<Item = Row>

Source

pub fn blob(&self, row: Row, column: u32) -> Blob<'_>

Source

pub fn equal_range( &self, file: u16, table: TableIndex, column: u32, value: u32, ) -> impl Iterator<Item = Row>

Source

pub fn upper_bound( &self, file: u16, table: TableIndex, column: u32, value: u32, ) -> Row

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.