pub struct SourceMapEntry {
pub ic: usize,
pub pc: usize,
pub bytecode_length: usize,
pub source_start: usize,
pub source_length: usize,
pub file_id: u32,
}Expand description
A bytecode source mapping entry
Fields§
§ic: usizeInstruction Counter (IC) - the instruction index (0, 1, 2, …) This is used to index into the source map array
pc: usizeProgram Counter (PC) - the byte offset in the bytecode where this instruction starts For example: if PUSH1 0x42 starts at byte 0, PC = 0
bytecode_length: usizeLength of the bytecode segment for this instruction (in bytes) For example: PUSH1 0x42 = 2 bytes, PUSH0 = 1 byte, SSTORE = 1 byte
source_start: usizeStart position in the source file (character offset)
source_length: usizeLength of the source code that generated this instruction (in characters) This is NOT the bytecode length, but the source text length
file_id: u32File ID for multi-file support (0 for main file, 1+ for includes)
Implementations§
Source§impl SourceMapEntry
impl SourceMapEntry
Sourcepub fn generate_solidity_source_map(entries: &[SourceMapEntry]) -> String
pub fn generate_solidity_source_map(entries: &[SourceMapEntry]) -> String
Generate a Solidity-compatible source map from a vector of SourceMapEntry
Solidity format: “s:l:f:j” where:
- s = source start position
- l = length in source (end - start)
- f = source file index (0 for single file)
- j = jump type (i/o/- for into/out/regular)
Multiple entries separated by semicolons, with omitted values if same as previous
Trait Implementations§
Source§impl Clone for SourceMapEntry
impl Clone for SourceMapEntry
Source§impl Debug for SourceMapEntry
impl Debug for SourceMapEntry
Source§impl Default for SourceMapEntry
impl Default for SourceMapEntry
Source§impl<'de> Deserialize<'de> for SourceMapEntry
impl<'de> Deserialize<'de> for SourceMapEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SourceMapEntry
Source§impl From<SourceMapEntry> for JsValuewhere
SourceMapEntry: Serialize,
impl From<SourceMapEntry> for JsValuewhere
SourceMapEntry: Serialize,
Source§fn from(value: SourceMapEntry) -> Self
fn from(value: SourceMapEntry) -> Self
Source§impl FromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
impl FromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &SourceMapEntrywhere
SourceMapEntry: Serialize,
impl IntoWasmAbi for &SourceMapEntrywhere
SourceMapEntry: Serialize,
Source§impl IntoWasmAbi for SourceMapEntrywhere
SourceMapEntry: Serialize,
impl IntoWasmAbi for SourceMapEntrywhere
SourceMapEntry: Serialize,
Source§impl OptionFromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for SourceMapEntrywhere
SourceMapEntry: Serialize,
impl OptionIntoWasmAbi for SourceMapEntrywhere
SourceMapEntry: Serialize,
Source§impl PartialEq for SourceMapEntry
impl PartialEq for SourceMapEntry
Source§impl RefFromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
impl RefFromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = SelfOwner<SourceMapEntry>
type Anchor = SelfOwner<SourceMapEntry>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for SourceMapEntry
impl Serialize for SourceMapEntry
impl StructuralPartialEq for SourceMapEntry
Source§impl Tsify for SourceMapEntry
impl Tsify for SourceMapEntry
const DECL: &'static str = "/**\n * A bytecode source mapping entry\n */\nexport interface SourceMapEntry {\n /**\n * Instruction Counter (IC) - the instruction index (0, 1, 2, ...)\n * This is used to index into the source map array\n */\n ic: number;\n /**\n * Program Counter (PC) - the byte offset in the bytecode where this instruction starts\n * For example: if PUSH1 0x42 starts at byte 0, PC = 0\n */\n pc: number;\n /**\n * Length of the bytecode segment for this instruction (in bytes)\n * For example: PUSH1 0x42 = 2 bytes, PUSH0 = 1 byte, SSTORE = 1 byte\n */\n bytecode_length: number;\n /**\n * Start position in the source file (character offset)\n */\n source_start: number;\n /**\n * Length of the source code that generated this instruction (in characters)\n * This is NOT the bytecode length, but the source text length\n */\n source_length: number;\n /**\n * File ID for multi-file support (0 for main file, 1+ for includes)\n */\n file_id?: number;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for SourceMapEntrywhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for SourceMapEntrywhere
SourceMapEntry: Serialize,
impl VectorIntoWasmAbi for SourceMapEntrywhere
SourceMapEntry: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribe for SourceMapEntry
impl WasmDescribe for SourceMapEntry
Auto Trait Implementations§
impl Freeze for SourceMapEntry
impl RefUnwindSafe for SourceMapEntry
impl Send for SourceMapEntry
impl Sync for SourceMapEntry
impl Unpin for SourceMapEntry
impl UnsafeUnpin for SourceMapEntry
impl UnwindSafe for SourceMapEntry
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.Source§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes