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
- ECMA-335, Partition II, §22.34 - Property table specification
crate::metadata::tables::Property- Owned variant for comparisoncrate::metadata::tables::PropertyMap- Property to type mappingcrate::metadata::signatures::SignatureProperty- Property signature details
Fields§
§rid: u32Row 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: TokenMetadata 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: usizeByte 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: u32Property 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: u32Index 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: u32Index 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
impl PropertyRaw
pub fn to_owned(
&self,
strings: &Strings<'_>,
blob: &Blob<'_>,
) -> Result<PropertyRc>
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 resolutionblob- The blob heap for signature parsing
§Returns
Ok(PropertyRc)- Successfully converted to owned representationErr(Error)- String resolution or signature parsing error
§Errors
crate::error::Error::OutOfBounds- Invalid string or blob heap indexcrate::error::Error::Malformed- Malformed property signature
pub fn apply(&self) -> Result<()>
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
impl Clone for PropertyRaw
§fn clone(&self) -> PropertyRaw
fn clone(&self) -> PropertyRaw
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PropertyRaw
impl Debug for PropertyRaw
§impl RowReadable for PropertyRaw
impl RowReadable for PropertyRaw
§fn row_read(
data: &[u8],
offset: &mut usize,
rid: u32,
sizes: &TableInfoRef,
) -> Result<Self>
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 fromoffset- 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 entryErr(Error)- Failed to read or parse the entry
§Errors
crate::error::Error::OutOfBounds- Insufficient data for complete entrycrate::error::Error::Malformed- Malformed table entry structure
§impl RowWritable for PropertyRaw
impl RowWritable for PropertyRaw
§fn row_write(
&self,
data: &mut [u8],
offset: &mut usize,
_rid: u32,
sizes: &TableInfoRef,
) -> Result<()>
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)
flags- Property attributes as 2-byte little-endian valuename- String heap index (2 or 4 bytes)signature- Blob heap index (2 or 4 bytes)
§Arguments
data- Target binary buffer for metadata tables streamoffset- 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
impl TableRow for PropertyRaw
§fn row_size(sizes: &TableInfoRef) -> u32
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 (
PropertyAttributesbitmask) - 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§
impl Freeze for PropertyRaw
impl RefUnwindSafe for PropertyRaw
impl Send for PropertyRaw
impl Sync for PropertyRaw
impl Unpin for PropertyRaw
impl UnwindSafe for PropertyRaw
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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