Skip to main content

TypeInfoEntry

Struct TypeInfoEntry 

Source
pub struct TypeInfoEntry<'a> { /* private fields */ }
Expand description

Zero-copy view of an MSFT_TypeInfoBase structure (0x64 bytes).

Each TypeInfo describes one type in the library: an enum, struct, module, COM interface, dispatch interface, coclass, alias, or union.

Constructed by TypeLib::typeinfo; the backing slice is guaranteed to be at least SIZE bytes.

Implementations§

Source§

impl<'a> TypeInfoEntry<'a>

Source

pub const SIZE: usize = 0x64

Size of the fixed MSFT_TypeInfoBase structure in bytes.

Source

pub fn as_bytes(&self) -> &'a [u8]

Returns the raw backing bytes.

Source

pub fn typekind(&self) -> TypeKind

Type kind (low 4 bits of the typekind field).

Source

pub fn typekind_raw(&self) -> u32

Raw typekind field (includes alignment in bits 11-15).

Source

pub fn memoffset(&self) -> i32

Absolute file offset to the func/var data block.

Returns a negative value when no data block exists.

Source

pub fn res2(&self) -> i32

First reference offset in pRefTab (for coclasses), or -1.

Source

pub fn celement(&self) -> u32

Raw cElement field.

Low 16 bits = function count, high 16 bits = variable count.

Source

pub fn func_count(&self) -> u16

Number of functions (low 16 bits of cElement).

Source

pub fn var_count(&self) -> u16

Number of variables (high 16 bits of cElement).

Source

pub fn guid_offset(&self) -> i32

Offset into the GUID table, or -1 if this type has no GUID.

Source

pub fn flags(&self) -> u32

TYPEFLAG_* flags.

Source

pub fn name_offset(&self) -> i32

Offset into the name table for this type’s name.

Source

pub fn version(&self) -> u32

Element version (set with SetVersion).

Source

pub fn docstring_offset(&self) -> i32

Offset into the string table for the doc string, or -1.

Source

pub fn cimpltypes(&self) -> i16

Number of implemented interfaces (for coclasses).

Source

pub fn cb_size_vft(&self) -> i16

Virtual function table size in bytes.

Source

pub fn size(&self) -> i32

Instance size in bytes.

Source

pub fn datatype1(&self) -> i32

For ALIAS types: the aliased type descriptor. Otherwise -1.

Source

pub fn datatype2(&self) -> i32

For ALIAS types: secondary aliased type descriptor. Otherwise -1.

Source

pub fn helpstringcontext(&self) -> i32

Help string context at offset 0x40.

Source

pub fn helpcontext(&self) -> i32

Help context at offset 0x44.

Source

pub fn cust_data_offset(&self) -> i32

Offset into the CDGuids directory for this type’s custom data, or -1.

Source

pub fn res3(&self) -> i32

Reserved field at offset 0x0C (-1 if no element, else (N-1)*0x38).

Source

pub fn res18(&self) -> i32

Reserved field at offset 0x5C (always 0).

Source

pub fn res19(&self) -> i32

Reserved field at offset 0x60 (always -1).

Trait Implementations§

Source§

impl<'a> Clone for TypeInfoEntry<'a>

Source§

fn clone(&self) -> TypeInfoEntry<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for TypeInfoEntry<'a>

Source§

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

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

impl<'a> Copy for TypeInfoEntry<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for TypeInfoEntry<'a>

§

impl<'a> RefUnwindSafe for TypeInfoEntry<'a>

§

impl<'a> Send for TypeInfoEntry<'a>

§

impl<'a> Sync for TypeInfoEntry<'a>

§

impl<'a> Unpin for TypeInfoEntry<'a>

§

impl<'a> UnsafeUnpin for TypeInfoEntry<'a>

§

impl<'a> UnwindSafe for TypeInfoEntry<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.