Trait RowReadable

pub trait RowReadable:
    Sized
    + Send
    + TableRow {
    // Required method
    fn row_read(
        data: &[u8],
        offset: &mut usize,
        rid: u32,
        sizes: &TableInfoRef,
    ) -> Result<Self>;
}
Expand description

Trait defining the interface for reading and parsing metadata table rows.

This trait must be implemented by any type that represents a row in a metadata table. It provides the necessary methods for parsing row data from byte buffers, enabling generic table operations.

§Implementation Requirements

Types implementing this trait must:

  • Be Send to support parallel processing
  • Handle parsing errors gracefully
  • Support 1-based row indexing (as per CLI specification)

Required Methods§

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

Reads and parses a single row from the provided byte buffer.

This method extracts and parses one complete row from the metadata table data, advancing the offset pointer to the next row position. The row ID follows the CLI specification’s 1-based indexing scheme.

§Arguments
  • data - The byte buffer containing the table data to read from
  • offset - Mutable reference to the current read position, automatically advanced by the number of bytes consumed
  • rid - The 1-based row identifier for this entry (starts at 1, not 0)
  • sizes - Table size information for parsing variable-sized fields
§Returns

Returns a Result containing the parsed row instance on success.

§Errors

Returns crate::Error in the following cases:

  • crate::Error - When the buffer contains insufficient data or malformed row structure
  • crate::Error - When heap indices reference invalid locations
  • crate::Error - When row identifiers are out of valid range

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl RowReadable for AssemblyOsRaw

§

impl RowReadable for AssemblyProcessorRaw

§

impl RowReadable for AssemblyRaw

§

impl RowReadable for AssemblyRefOsRaw

§

impl RowReadable for AssemblyRefProcessorRaw

§

impl RowReadable for AssemblyRefRaw

§

impl RowReadable for ClassLayoutRaw

§

impl RowReadable for ConstantRaw

§

impl RowReadable for CustomAttributeRaw

§

impl RowReadable for CustomDebugInformationRaw

§

impl RowReadable for DeclSecurityRaw

§

impl RowReadable for DocumentRaw

§

impl RowReadable for EncLogRaw

§

impl RowReadable for EncMapRaw

§

impl RowReadable for EventMapRaw

§

impl RowReadable for EventPtrRaw

§

impl RowReadable for EventRaw

§

impl RowReadable for ExportedTypeRaw

§

impl RowReadable for FieldLayoutRaw

§

impl RowReadable for FieldMarshalRaw

§

impl RowReadable for FieldPtrRaw

§

impl RowReadable for FieldRaw

§

impl RowReadable for FieldRvaRaw

§

impl RowReadable for FileRaw

§

impl RowReadable for GenericParamConstraintRaw

§

impl RowReadable for GenericParamRaw

§

impl RowReadable for ImplMapRaw

§

impl RowReadable for ImportScopeRaw

§

impl RowReadable for InterfaceImplRaw

§

impl RowReadable for LocalConstantRaw

§

impl RowReadable for LocalScopeRaw

§

impl RowReadable for LocalVariableRaw

§

impl RowReadable for ManifestResourceRaw

§

impl RowReadable for MemberRefRaw

§

impl RowReadable for MethodDebugInformationRaw

§

impl RowReadable for MethodDefRaw

§

impl RowReadable for MethodImplRaw

§

impl RowReadable for MethodPtrRaw

§

impl RowReadable for MethodSemanticsRaw

§

impl RowReadable for MethodSpecRaw

§

impl RowReadable for ModuleRaw

§

impl RowReadable for ModuleRefRaw

§

impl RowReadable for NestedClassRaw

§

impl RowReadable for ParamPtrRaw

§

impl RowReadable for ParamRaw

§

impl RowReadable for PropertyMapRaw

§

impl RowReadable for PropertyPtrRaw

§

impl RowReadable for PropertyRaw

§

impl RowReadable for StandAloneSigRaw

§

impl RowReadable for StateMachineMethodRaw

§

impl RowReadable for TypeDefRaw

§

impl RowReadable for TypeRefRaw

§

impl RowReadable for TypeSpecRaw