Struct EncMapRaw
pub struct EncMapRaw {
pub rid: u32,
pub token: Token,
pub offset: usize,
pub original_token: Token,
}Expand description
Raw representation of a row in the EncMap metadata table.
The EncMap table manages token mapping during Edit-and-Continue debugging operations.
Each row contains an original metadata token that was present before code editing occurred.
The table position provides an implicit mapping to the corresponding updated token.
§Fields Overview
- rid: Row identifier within the
EncMaptable - token: Metadata token for this mapping entry
- offset: Byte offset within the
EncMaptable data original_token: The original metadata token before editing
§Token Correlation
The EncMap table provides implicit mapping through table position:
- Row N in
EncMapcontains the original token - The updated token is determined by the debugger’s token allocation
- Position-based correlation enables efficient token mapping
§ECMA-335 Compliance
This structure directly corresponds to the EncMap table format specified in
ECMA-335, Partition II, Section 22.13.
Table ID: 0x1F
Fields§
§rid: u32Row identifier within the EncMap table.
This 1-based index uniquely identifies this token mapping within the table.
token: TokenMetadata token for this EncMap entry.
Constructed as 0x1F000000 | rid, providing a unique identifier
for this mapping entry within the metadata system.
offset: usizeByte offset of this row within the EncMap table data.
Used for debugging and low-level table operations.
original_token: TokenOriginal metadata token before Edit-and-Continue operation.
This token represents the metadata element before any editing occurred. The debugger uses this value to correlate with updated tokens after editing.
Implementations§
§impl EncMapRaw
impl EncMapRaw
pub fn to_owned(&self) -> Result<EncMapRc>
pub fn to_owned(&self) -> Result<EncMapRc>
Converts this raw EncMap entry to its owned representation.
EncMap entries contain self-contained token mapping information and don’t require
additional context for conversion. The conversion preserves all token mapping data
with the dual variant pattern used across all metadata tables.
§Arguments
This method doesn’t require additional context as EncMap entries are self-contained.
§Returns
Returns Ok(crate::metadata::tables::EncMapRc) - Reference-counted EncMap data
§Errors
This method currently cannot fail as EncMap entries are self-contained.
§Examples
let owned = raw.to_owned()?;pub fn apply(&self) -> Result<()>
pub fn apply(&self) -> Result<()>
Applies this EncMap entry to update related metadata structures.
EncMap entries provide token mapping information but don’t directly modify
other metadata structures. Token mapping is typically handled by debugger
infrastructure during Edit-and-Continue operations.
§Returns
Always returns Ok(()) as EncMap entries don’t modify other metadata directly.
§Errors
This method currently cannot fail as EncMap entries don’t modify other metadata directly.
§ECMA-335 Reference
See ECMA-335, Partition II, Section 22.13 for EncMap table semantics.
Trait Implementations§
§impl RowReadable for EncMapRaw
impl RowReadable for EncMapRaw
§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>
Parse a single EncMap table row from binary metadata.
Reads and validates an EncMap entry from the metadata stream according to the
ECMA-335 specification. The method constructs a complete EncMapRaw instance
with all fields populated from the binary data.
§Arguments
data- Binary metadata containing theEncMaptableoffset- Current read position, updated after readingrid- Row identifier for this entry (1-based)sizes- Table size information (unused forEncMap)
§Returns
Returns an EncMapRaw instance with all fields populated from the binary data.
§Errors
Returns an error if the binary data is insufficient or malformed.
§impl RowWritable for EncMapRaw
impl RowWritable for EncMapRaw
§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 an EncMap table row to binary data
Serializes one EncMap table entry to the metadata tables stream format.
The single field is a fixed-size 4-byte token written in little-endian format.
§Arguments
data- Target binary buffer for metadata tables streamoffset- Current write position (updated after writing)_rid- Row identifier for this mapping entry (unused forEncMap)_sizes- Table sizing information (unused forEncMap)
§Returns
Ok(())- Successfully serialized Edit-and-Continue mapping entryErr(crate::Error)- If buffer is too small or write fails
§Binary Format
Fields are written in the exact order specified by the ECMA-335 specification:
- Original token value (4 bytes, little-endian)
§impl TableRow for EncMapRaw
impl TableRow for EncMapRaw
§fn row_size(_sizes: &TableInfoRef) -> u32
fn row_size(_sizes: &TableInfoRef) -> u32
Calculate the size in bytes of an EncMap table row.
The EncMap table has a fixed structure with one 4-byte token field.
Size calculation is independent of heap sizes since no heap references are used.
§Layout
- Token (4 bytes): Original metadata token
§Arguments
sizes- Table size information (unused forEncMap)
§Returns
Always returns 4 bytes for the fixed token field.
Auto Trait Implementations§
impl Freeze for EncMapRaw
impl RefUnwindSafe for EncMapRaw
impl Send for EncMapRaw
impl Sync for EncMapRaw
impl Unpin for EncMapRaw
impl UnsafeUnpin for EncMapRaw
impl UnwindSafe for EncMapRaw
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.