Struct PropertyRaw

pub struct PropertyRaw {
    pub rid: u32,
    pub token: Token,
    pub offset: usize,
    pub flags: u32,
    pub name: u32,
    pub signature: u32,
}
Expand description

Raw representation of a Property table entry with unresolved indexes.

This structure represents the unprocessed entry from the Property metadata table (ID 0x17), which defines properties exposed by types in .NET assemblies. It contains raw index values that require resolution to actual metadata objects.

§Purpose

The Property table provides the foundation for .NET property system:

  • Property Definition: Defines property names, types, and characteristics
  • Type Integration: Associates properties with their declaring types
  • Method Binding: Links properties to getter/setter methods via MethodSemantics
  • Reflection Foundation: Enables property-based reflection and metadata queries

§Raw vs Owned

This raw variant is used during initial metadata parsing and contains:

  • Unresolved string heap indexes requiring name lookup
  • Unresolved blob heap indexes requiring signature parsing
  • Minimal memory footprint for storage during parsing
  • Direct representation of on-disk table structure

§Property Attributes

Properties can have various attributes that control their behavior:

  • SpecialName: Property has special naming conventions (0x0200)
  • RTSpecialName: Runtime should verify name encoding (0x0400)
  • HasDefault: Property has a default value defined (0x1000)

§References

Fields§

§rid: u32

Row identifier within the Property table (1-based indexing).

This field provides the logical position of this entry within the Property table, following the standard 1-based indexing convention used throughout .NET metadata.

§token: Token

Metadata token uniquely identifying this Property entry.

The token combines the table identifier (Property = 0x17) with the row ID, providing a unique reference for this property across the entire metadata system.

§offset: usize

Byte offset of this entry within the metadata stream.

This offset indicates the exact position of this Property entry within the metadata stream, enabling direct access to the raw table data and supporting metadata analysis and debugging operations.

§flags: u32

Property attribute flags defining characteristics and behavior.

A 2-byte bitmask of PropertyAttributes (ECMA-335 §II.23.1.14) that controls various aspects of the property including special naming, default values, and runtime behavior. See super::PropertyAttributes for flag definitions.

§name: u32

Index into the string heap for the property name.

This field contains the heap index that must be resolved to obtain the actual property name string. The name provides the identifier used for property access and reflection operations.

§signature: u32

Index into the blob heap for the property signature.

This field contains the heap index that must be resolved and parsed to obtain the complete property signature, including property type, parameter types for indexers, and calling conventions.

Implementations§

§

impl PropertyRaw

pub fn to_owned( &self, strings: &Strings<'_>, blob: &Blob<'_>, ) -> Result<PropertyRc>

Converts this raw Property entry to its owned representation.

This method transforms the raw table entry into a fully owned Property instance with resolved names and parsed signatures. The conversion involves string heap lookup for the property name and blob heap parsing for the property signature.

§Arguments
  • strings - The string heap for name resolution
  • blob - The blob heap for signature parsing
§Returns
  • Ok(PropertyRc) - Successfully converted to owned representation
  • Err(Error) - String resolution or signature parsing error
§Errors

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

Applies this Property entry to the metadata loading process.

Property entries define properties that types can expose but do not directly modify other metadata structures during the loading process. Property method associations (getter, setter, other) are resolved separately through the MethodSemantics table during higher-level metadata resolution.

This method is provided for consistency with the table loading framework but performs no operations for Property entries.

§Returns
  • Ok(()) - Always succeeds as no processing is required
§Errors

This function does not return errors. It always returns Ok(()).

Trait Implementations§

§

impl Clone for PropertyRaw

§

fn clone(&self) -> PropertyRaw

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
§

impl Debug for PropertyRaw

§

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

Formats the value using the given formatter. Read more
§

impl RowReadable for PropertyRaw

§

fn row_read( data: &[u8], offset: &mut usize, rid: u32, sizes: &TableInfoRef, ) -> Result<Self>

Reads a single Property table row from metadata bytes.

This method parses a Property entry from the metadata stream, extracting the property flags, name index, and signature index to construct the complete row structure with metadata context.

§Arguments
  • data - The metadata bytes to read from
  • offset - Current position in the data (updated after reading)
  • rid - Row identifier for this entry (1-based)
  • sizes - Table size configuration for index resolution
§Returns
  • Ok(PropertyRaw) - Successfully parsed Property entry
  • Err(Error) - Failed to read or parse the entry
§Errors
§

impl RowWritable for PropertyRaw

§

fn row_write( &self, data: &mut [u8], offset: &mut usize, _rid: u32, sizes: &TableInfoRef, ) -> Result<()>

Write a Property table row to binary data

Serializes one Property table entry to the metadata tables stream format, handling variable-width heap indexes based on the table size information.

§Field Serialization Order (ECMA-335)
  1. flags - Property attributes as 2-byte little-endian value
  2. name - String heap index (2 or 4 bytes)
  3. signature - Blob heap index (2 or 4 bytes)
§Arguments
  • data - Target binary buffer for metadata tables stream
  • offset - Current write position (updated after writing)
  • rid - Row identifier (unused for Property serialization)
  • sizes - Table size information for determining index widths
§Returns

Ok(()) on successful serialization, error if buffer is too small

§Errors

Returns an error if:

  • The target buffer is too small for the row data
§

impl TableRow for PropertyRaw

§

fn row_size(sizes: &TableInfoRef) -> u32

Calculates the byte size of a single Property table row.

The size depends on the metadata heap size configuration:

  • flags: 2 bytes (PropertyAttributes bitmask)
  • name: String heap index size (2 or 4 bytes)
  • signature: Blob heap index size (2 or 4 bytes)
§Arguments
  • sizes - Table size configuration information
§Returns
  • u32 - Total row size in bytes (6-10 bytes typically)

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> 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> 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> 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.