wasmtime

Struct FrameInfo

Source
pub struct FrameInfo { /* private fields */ }
Available on crate feature runtime only.
Expand description

Description of a frame in a backtrace for a WasmBacktrace.

Whenever an error happens while WebAssembly is executing a WasmBacktrace will be attached to the error returned which can be used to acquire this FrameInfo. For more information see WasmBacktrace.

Implementations§

Source§

impl FrameInfo

Source

pub fn func_index(&self) -> u32

Returns the WebAssembly function index for this frame.

This function index is the index in the function index space of the WebAssembly module that this frame comes from.

Source

pub fn module(&self) -> &Module

Returns the module for this frame.

This is the module who’s code was being run in this frame.

Source

pub fn func_name(&self) -> Option<&str>

Returns a descriptive name of the function for this frame, if one is available.

The name of this function may come from the name section of the WebAssembly binary, or wasmtime may try to infer a better name for it if not available, for example the name of the export if it’s exported.

This return value is primarily used for debugging and human-readable purposes for things like traps. Note that the exact return value may be tweaked over time here and isn’t guaranteed to be something in particular about a wasm module due to its primary purpose of assisting in debugging.

This function returns None when no name could be inferred.

Source

pub fn module_offset(&self) -> Option<usize>

Returns the offset within the original wasm module this frame’s program counter was at.

The offset here is the offset from the beginning of the original wasm module to the instruction that this frame points to.

Note that None may be returned if the original module was not compiled with mapping information to yield this information. This is controlled by the Config::generate_address_map configuration option.

Source

pub fn func_offset(&self) -> Option<usize>

Returns the offset from the original wasm module’s function to this frame’s program counter.

The offset here is the offset from the beginning of the defining function of this frame (within the wasm module) to the instruction this frame points to.

Note that None may be returned if the original module was not compiled with mapping information to yield this information. This is controlled by the Config::generate_address_map configuration option.

Source

pub fn symbols(&self) -> &[FrameSymbol]

Returns the debug symbols found, if any, for this function frame.

When a wasm program is compiled with DWARF debug information then this function may be populated to return symbols which contain extra debug information about a frame including the filename and line number. If no debug information was found or if it was malformed then this will return an empty array.

Trait Implementations§

Source§

impl Debug for FrameInfo

Source§

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

Formats the value using the given formatter. Read more

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

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

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