Struct InterfaceImpl

pub struct InterfaceImpl {
    pub rid: u32,
    pub token: Token,
    pub offset: usize,
    pub class: CilTypeRc,
    pub interface: CilTypeRc,
    pub custom_attributes: CustomAttributeValueList,
}
Expand description

Owned InterfaceImpl table entry with resolved type references and owned data.

This structure represents an interface implementation relationship with all coded indexes resolved to their target type structures. It defines which types implement which interfaces, forming the foundation of .NET’s interface-based inheritance system.

§Interface Implementation Types

The structure handles two distinct relationship patterns:

  • Class implements interface: Standard interface implementation by concrete types
  • Interface extends interface: Interface inheritance (incorrectly placed in InterfaceImpl by compiler)

Fields§

§rid: u32

Row identifier within the InterfaceImpl table.

Unique identifier for this interface implementation entry, used for internal table management and cross-references.

§token: Token

Metadata token identifying this InterfaceImpl entry.

The token enables efficient lookup and reference to this interface implementation from other metadata structures and runtime systems.

§offset: usize

Byte offset of this entry within the raw table data.

Used for efficient table navigation and binary metadata processing.

§class: CilTypeRc

Resolved reference to the type that implements the interface.

Points to the class or interface that declares implementation of the target interface. In cases of interface inheritance, this may also be an interface type.

§interface: CilTypeRc

Resolved reference to the interface being implemented.

Points to the interface type that is being implemented or extended. This may be a generic interface instantiation for parameterized interface implementations.

§custom_attributes: CustomAttributeValueList

Custom attributes applied to this interface implementation.

Collection of custom attributes that provide additional metadata about the interface implementation relationship, such as explicit implementation attributes.

Implementations§

§

impl InterfaceImpl

pub fn apply(&self) -> Result<()>

Applies the interface implementation relationship to the type system.

This method establishes the interface implementation relationship by updating the implementing type’s interface list or base type. It handles both standard interface implementation and interface inheritance patterns.

§Returns
  • Ok(()) - Interface implementation applied successfully
  • Err(_) - Reserved for future error conditions (currently infallible)
§Errors

This function never returns an error; it always returns Ok(()).

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.