Enum TableData

pub enum TableData<'a> {
Show 53 variants Module(MetadataTable<'a, ModuleRaw>), TypeRef(MetadataTable<'a, TypeRefRaw>), TypeDef(MetadataTable<'a, TypeDefRaw>), FieldPtr(MetadataTable<'a, FieldPtrRaw>), Field(MetadataTable<'a, FieldRaw>), MethodPtr(MetadataTable<'a, MethodPtrRaw>), MethodDef(MetadataTable<'a, MethodDefRaw>), ParamPtr(MetadataTable<'a, ParamPtrRaw>), Param(MetadataTable<'a, ParamRaw>), InterfaceImpl(MetadataTable<'a, InterfaceImplRaw>), MemberRef(MetadataTable<'a, MemberRefRaw>), Constant(MetadataTable<'a, ConstantRaw>), CustomAttribute(MetadataTable<'a, CustomAttributeRaw>), FieldMarshal(MetadataTable<'a, FieldMarshalRaw>), DeclSecurity(MetadataTable<'a, DeclSecurityRaw>), Document(MetadataTable<'a, DocumentRaw>), MethodDebugInformation(MetadataTable<'a, MethodDebugInformationRaw>), LocalScope(MetadataTable<'a, LocalScopeRaw>), LocalVariable(MetadataTable<'a, LocalVariableRaw>), LocalConstant(MetadataTable<'a, LocalConstantRaw>), ImportScope(MetadataTable<'a, ImportScopeRaw>), StateMachineMethod(MetadataTable<'a, StateMachineMethodRaw>), CustomDebugInformation(MetadataTable<'a, CustomDebugInformationRaw>), EncLog(MetadataTable<'a, EncLogRaw>), EncMap(MetadataTable<'a, EncMapRaw>), ClassLayout(MetadataTable<'a, ClassLayoutRaw>), FieldLayout(MetadataTable<'a, FieldLayoutRaw>), StandAloneSig(MetadataTable<'a, StandAloneSigRaw>), EventMap(MetadataTable<'a, EventMapRaw>), EventPtr(MetadataTable<'a, EventPtrRaw>), Event(MetadataTable<'a, EventRaw>), PropertyMap(MetadataTable<'a, PropertyMapRaw>), PropertyPtr(MetadataTable<'a, PropertyPtrRaw>), Property(MetadataTable<'a, PropertyRaw>), MethodSemantics(MetadataTable<'a, MethodSemanticsRaw>), MethodImpl(MetadataTable<'a, MethodImplRaw>), ModuleRef(MetadataTable<'a, ModuleRefRaw>), TypeSpec(MetadataTable<'a, TypeSpecRaw>), ImplMap(MetadataTable<'a, ImplMapRaw>), FieldRVA(MetadataTable<'a, FieldRvaRaw>), Assembly(MetadataTable<'a, AssemblyRaw>), AssemblyProcessor(MetadataTable<'a, AssemblyProcessorRaw>), AssemblyOS(MetadataTable<'a, AssemblyOsRaw>), AssemblyRef(MetadataTable<'a, AssemblyRefRaw>), AssemblyRefProcessor(MetadataTable<'a, AssemblyRefProcessorRaw>), AssemblyRefOS(MetadataTable<'a, AssemblyRefOsRaw>), File(MetadataTable<'a, FileRaw>), ExportedType(MetadataTable<'a, ExportedTypeRaw>), ManifestResource(MetadataTable<'a, ManifestResourceRaw>), NestedClass(MetadataTable<'a, NestedClassRaw>), GenericParam(MetadataTable<'a, GenericParamRaw>), MethodSpec(MetadataTable<'a, MethodSpecRaw>), GenericParamConstraint(MetadataTable<'a, GenericParamConstraintRaw>),
}
Expand description

Unified enumeration representing all possible metadata tables in a CLI assembly.

This enum provides a type-safe way to handle any of the metadata tables that can exist in the #~ or #- stream of a .NET assembly. Each variant corresponds to a specific table type as defined in ECMA-335, containing a crate::metadata::tables::types::MetadataTable with the appropriate row type.

§Table Organization

The variants are organized to follow the standard table numbering scheme used in .NET metadata, making it easy to map between table IDs and enum variants.

§Pattern Matching

This enum is designed for pattern matching to handle different table types:

use dotscope::metadata::tables::types::TableData;

fn analyze_table(table: &TableData) -> String {
    match table {
        TableData::TypeDef(types) => {
            format!("Found {} type definitions", types.row_count)
        }
        TableData::MethodDef(methods) => {
            format!("Found {} method definitions", methods.row_count)
        }
        TableData::Field(fields) => {
            format!("Found {} field definitions", fields.row_count)
        }
        // Handle other table types...
        _ => "Other table type".to_string(),
    }
}

Variants§

§

Module(MetadataTable<'a, ModuleRaw>)

Module table containing assembly module information.

This table contains basic information about the current module, including its name, version identifier, and generation. There is typically only one row in this table per module.

§

TypeRef(MetadataTable<'a, TypeRefRaw>)

TypeRef table containing references to external types.

This table holds references to types defined in other assemblies or modules that are used by the current assembly. Each row represents a type reference with resolution scope and name information.

§

TypeDef(MetadataTable<'a, TypeDefRaw>)

TypeDef table containing type definitions within this assembly.

This is one of the core tables containing definitions of all types (classes, interfaces, value types, etc.) defined in the current assembly. Each row represents a complete type definition with flags, name, and layout information.

§

FieldPtr(MetadataTable<'a, FieldPtrRaw>)

FieldPtr table providing indirection for field ordering.

This optional table is used when field ordering needs to be different from the physical layout in the Field table. It contains pointers to Field table entries in the desired logical order.

§

Field(MetadataTable<'a, FieldRaw>)

Field table containing field definitions.

This table defines all fields within types, including their attributes, names, and type signatures. Fields are associated with types through the TypeDef table’s field list ranges.

§

MethodPtr(MetadataTable<'a, MethodPtrRaw>)

MethodPtr table providing indirection for method ordering.

Similar to FieldPtr, this optional table allows reordering of methods independently of their physical layout in the MethodDef table.

§

MethodDef(MetadataTable<'a, MethodDefRaw>)

MethodDef table containing method definitions.

This table defines all methods within types, including their attributes, names, signatures, and implementation details. Methods are associated with types through the TypeDef table’s method list ranges.

§

ParamPtr(MetadataTable<'a, ParamPtrRaw>)

ParamPtr table providing indirection for parameter ordering.

This optional table allows reordering of parameters independently of their physical layout in the Param table.

§

Param(MetadataTable<'a, ParamRaw>)

Param table containing method parameter definitions.

This table defines parameters for methods, including their attributes, names, and sequence information. Parameters are associated with methods through the MethodDef table’s parameter list ranges.

§

InterfaceImpl(MetadataTable<'a, InterfaceImplRaw>)

InterfaceImpl table containing interface implementation relationships.

This table records which interfaces are implemented by which types, establishing the inheritance hierarchy for interface implementations.

§

MemberRef(MetadataTable<'a, MemberRefRaw>)

MemberRef table containing references to external members.

This table holds references to methods, fields, or other members defined in external assemblies or modules. Each entry includes the member’s parent type, name, and signature.

§

Constant(MetadataTable<'a, ConstantRaw>)

Constant table containing constant value definitions.

This table stores constant values that can be associated with fields, parameters, or properties. Each entry specifies the constant’s type and value.

§

CustomAttribute(MetadataTable<'a, CustomAttributeRaw>)

CustomAttribute table containing custom attribute applications.

This table records the application of custom attributes to various metadata entities. Each entry specifies the target entity, the attribute constructor, and the attribute arguments.

§

FieldMarshal(MetadataTable<'a, FieldMarshalRaw>)

FieldMarshal table containing field marshalling information.

This table provides marshalling information for fields and parameters when interoperating with unmanaged code. Each entry specifies how the managed type should be marshalled.

§

DeclSecurity(MetadataTable<'a, DeclSecurityRaw>)

DeclSecurity table containing declarative security information.

This table stores declarative security attributes applied to types or methods, including permission sets and security actions.

§

Document(MetadataTable<'a, DocumentRaw>)

Document table containing Portable PDB document information.

This table contains information about source documents referenced in debug information, including document names, hash algorithms, hashes, and source language identifiers.

§

MethodDebugInformation(MetadataTable<'a, MethodDebugInformationRaw>)

MethodDebugInformation table containing method debugging details.

This table contains debugging information for methods, including sequence points that map IL instructions to source code locations. Essential for stepping through code during debugging sessions in Portable PDB format.

§

LocalScope(MetadataTable<'a, LocalScopeRaw>)

LocalScope table containing local variable scope information.

This table defines the scope ranges where local variables and constants are active within methods. Used by debuggers to determine variable visibility and lifetime at different execution points in Portable PDB format.

§

LocalVariable(MetadataTable<'a, LocalVariableRaw>)

LocalVariable table containing local variable information.

This table stores information about local variables within method scopes, including their names, signatures, and attributes. Used by debuggers to display variable names and values during code execution in Portable PDB format.

§

LocalConstant(MetadataTable<'a, LocalConstantRaw>)

LocalConstant table containing local constant information.

This table stores information about local constants within method scopes, including their names, signatures, and constant values. Used by debuggers to display constant values during code execution in Portable PDB format.

§

ImportScope(MetadataTable<'a, ImportScopeRaw>)

ImportScope table containing namespace import scope information.

This table records the import scopes for namespaces and types, used to resolve type names and provide proper IntelliSense support during debugging in Portable PDB format.

§

StateMachineMethod(MetadataTable<'a, StateMachineMethodRaw>)

StateMachineMethod table containing async/iterator method mappings.

This table maps compiler-generated state machine MoveNext methods back to their original user-written async/await and iterator methods. Essential for providing a seamless debugging experience with modern C# and VB.NET features in Portable PDB format.

§

CustomDebugInformation(MetadataTable<'a, CustomDebugInformationRaw>)

CustomDebugInformation table containing extensible debug information.

This table allows compilers and tools to store additional debugging metadata beyond the standard Portable PDB tables. Each entry contains a GUID identifying the information type and a blob containing the actual data.

§

EncLog(MetadataTable<'a, EncLogRaw>)

EncLog table containing Edit-and-Continue log information.

This table tracks metadata changes for Edit-and-Continue debugging scenarios, recording which metadata tokens have been modified during compilation.

§

EncMap(MetadataTable<'a, EncMapRaw>)

EncMap table containing Edit-and-Continue token mapping.

This table maps original metadata tokens to their updated versions after Edit-and-Continue operations, enabling proper token correlation during debugging.

§

ClassLayout(MetadataTable<'a, ClassLayoutRaw>)

ClassLayout table containing type layout information.

This table specifies explicit layout information for value types and classes, including packing size and total size constraints.

§

FieldLayout(MetadataTable<'a, FieldLayoutRaw>)

FieldLayout table containing field layout information.

This table specifies the explicit offset of fields within types that use explicit layout. Each entry maps a field to its byte offset.

§

StandAloneSig(MetadataTable<'a, StandAloneSigRaw>)

StandAloneSig table containing standalone signature definitions.

This table holds method signatures that are not directly associated with method definitions, such as function pointer signatures or call site signatures.

§

EventMap(MetadataTable<'a, EventMapRaw>)

EventMap table mapping types to their event ranges.

This table maps types to the events they define, similar to how TypeDef maps to fields and methods.

§

EventPtr(MetadataTable<'a, EventPtrRaw>)

EventPtr table providing indirection for event ordering.

This optional table allows reordering of events independently of their physical layout in the Event table.

§

Event(MetadataTable<'a, EventRaw>)

Event table containing event definitions.

This table defines events within types, including their attributes, names, and event handler type. Events are associated with types through the EventMap table.

§

PropertyMap(MetadataTable<'a, PropertyMapRaw>)

PropertyMap table mapping types to their property ranges.

This table establishes the relationship between types and the properties they define, enabling property enumeration for each type.

§

PropertyPtr(MetadataTable<'a, PropertyPtrRaw>)

PropertyPtr table providing indirection for property ordering.

This optional table allows reordering of properties independently of their physical layout in the Property table.

§

Property(MetadataTable<'a, PropertyRaw>)

Property table containing property definitions.

This table defines properties within types, including their attributes, names, and type signatures. Properties are associated with types through the PropertyMap table.

§

MethodSemantics(MetadataTable<'a, MethodSemanticsRaw>)

MethodSemantics table containing method semantic relationships.

This table associates methods with properties and events, defining relationships like getter/setter methods for properties or add/remove methods for events.

§

MethodImpl(MetadataTable<'a, MethodImplRaw>)

MethodImpl table containing method implementation mappings.

This table specifies which method bodies implement which method declarations, particularly important for interface method implementations and method overrides.

§

ModuleRef(MetadataTable<'a, ModuleRefRaw>)

ModuleRef table containing references to external modules.

This table holds references to external modules that contain types or members referenced by the current assembly.

§

TypeSpec(MetadataTable<'a, TypeSpecRaw>)

TypeSpec table containing constructed type specifications.

This table defines complex type constructions such as generic instantiations, arrays, pointers, and other derived types that cannot be represented by simple TypeDef or TypeRef entries.

§

ImplMap(MetadataTable<'a, ImplMapRaw>)

ImplMap table containing P/Invoke implementation mappings.

This table provides mapping information for Platform Invoke (P/Invoke) calls, specifying the target DLL, entry point, and calling conventions for unmanaged method calls.

§

FieldRVA(MetadataTable<'a, FieldRvaRaw>)

FieldRVA table containing field relative virtual addresses.

This table maps fields to their initial data locations within the assembly file, typically used for static fields with initial values.

§

Assembly(MetadataTable<'a, AssemblyRaw>)

Assembly table containing assembly identity and metadata.

This table contains information about the current assembly, including version, culture, public key, and other identity information. There is typically only one row in this table per assembly.

§

AssemblyProcessor(MetadataTable<'a, AssemblyProcessorRaw>)

AssemblyProcessor table containing processor architecture information.

This deprecated table was used to specify supported processor architectures for the assembly. Modern assemblies typically don’t use this table.

§

AssemblyOS(MetadataTable<'a, AssemblyOsRaw>)

AssemblyOS table containing operating system information.

This deprecated table was used to specify supported operating systems for the assembly. Modern assemblies typically don’t use this table.

§

AssemblyRef(MetadataTable<'a, AssemblyRefRaw>)

AssemblyRef table containing external assembly references.

This table holds references to external assemblies that contain types or members used by the current assembly. Each entry includes version and identity information for the referenced assembly.

§

AssemblyRefProcessor(MetadataTable<'a, AssemblyRefProcessorRaw>)

AssemblyRefProcessor table containing processor info for external assemblies.

This deprecated table was used to specify processor requirements for referenced assemblies. Modern assemblies typically don’t use this table.

§

AssemblyRefOS(MetadataTable<'a, AssemblyRefOsRaw>)

AssemblyRefOS table containing OS info for external assemblies.

This deprecated table was used to specify operating system requirements for referenced assemblies. Modern assemblies typically don’t use this table.

§

File(MetadataTable<'a, FileRaw>)

File table containing files in the assembly manifest.

This table lists all files that are part of the assembly manifest, including their names and hash information for integrity verification.

§

ExportedType(MetadataTable<'a, ExportedTypeRaw>)

ExportedType table containing types exported by this assembly.

This table lists types that are defined in other files of the assembly but are exported through this assembly’s public interface.

§

ManifestResource(MetadataTable<'a, ManifestResourceRaw>)

ManifestResource table containing resources in the assembly manifest.

This table lists all resources that are embedded in or linked to the assembly, including their names, attributes, and location information.

§

NestedClass(MetadataTable<'a, NestedClassRaw>)

NestedClass table containing nested type relationships.

This table establishes parent-child relationships between types, identifying which types are nested within other types.

§

GenericParam(MetadataTable<'a, GenericParamRaw>)

GenericParam table containing generic parameter definitions.

This table defines generic parameters for generic types and methods, including their names, constraints, and variance information.

§

MethodSpec(MetadataTable<'a, MethodSpecRaw>)

MethodSpec table containing generic method instantiations.

This table represents specific instantiations of generic methods with concrete type arguments, enabling efficient representation of generic method calls.

§

GenericParamConstraint(MetadataTable<'a, GenericParamConstraintRaw>)

GenericParamConstraint table containing generic parameter constraints.

This table specifies type constraints for generic parameters, defining which types or interfaces a generic parameter must implement or extend.

Auto Trait Implementations§

§

impl<'a> Freeze for TableData<'a>

§

impl<'a> RefUnwindSafe for TableData<'a>

§

impl<'a> Send for TableData<'a>

§

impl<'a> Sync for TableData<'a>

§

impl<'a> Unpin for TableData<'a>

§

impl<'a> UnwindSafe for TableData<'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> 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.