Struct wasm_encoder::CoreDumpStackSection
source · pub struct CoreDumpStackSection { /* private fields */ }
Expand description
A “corestack” custom section as described in the tool-conventions repository
§Example
use wasm_encoder::{CoreDumpStackSection, Module, CoreDumpValue};
let mut thread = CoreDumpStackSection::new("main");
let instance_index = 0;
let func_index = 42;
let code_offset = 0x1234;
let locals = vec![CoreDumpValue::I32(1)];
let stack = vec![CoreDumpValue::I32(2)];
thread.frame(instance_index, func_index, code_offset, locals, stack);
let mut module = Module::new();
module.section(&thread);
Implementations§
source§impl CoreDumpStackSection
impl CoreDumpStackSection
sourcepub fn frame<L, S>(
&mut self,
instanceidx: u32,
funcidx: u32,
codeoffset: u32,
locals: L,
stack: S,
) -> &mut Selfwhere
L: IntoIterator<Item = CoreDumpValue>,
<L as IntoIterator>::IntoIter: ExactSizeIterator,
S: IntoIterator<Item = CoreDumpValue>,
<S as IntoIterator>::IntoIter: ExactSizeIterator,
pub fn frame<L, S>(
&mut self,
instanceidx: u32,
funcidx: u32,
codeoffset: u32,
locals: L,
stack: S,
) -> &mut Selfwhere
L: IntoIterator<Item = CoreDumpValue>,
<L as IntoIterator>::IntoIter: ExactSizeIterator,
S: IntoIterator<Item = CoreDumpValue>,
<S as IntoIterator>::IntoIter: ExactSizeIterator,
Add a stack frame to this coredump stack section.
sourcepub fn as_custom<'a>(&'a self) -> CustomSection<'a>
pub fn as_custom<'a>(&'a self) -> CustomSection<'a>
View the encoded section as a CustomSection.
Trait Implementations§
source§impl Clone for CoreDumpStackSection
impl Clone for CoreDumpStackSection
source§fn clone(&self) -> CoreDumpStackSection
fn clone(&self) -> CoreDumpStackSection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CoreDumpStackSection
impl Debug for CoreDumpStackSection
source§impl Default for CoreDumpStackSection
impl Default for CoreDumpStackSection
source§fn default() -> CoreDumpStackSection
fn default() -> CoreDumpStackSection
Returns the “default value” for a type. Read more
source§impl Encode for CoreDumpStackSection
impl Encode for CoreDumpStackSection
Auto Trait Implementations§
impl Freeze for CoreDumpStackSection
impl RefUnwindSafe for CoreDumpStackSection
impl Send for CoreDumpStackSection
impl Sync for CoreDumpStackSection
impl Unpin for CoreDumpStackSection
impl UnwindSafe for CoreDumpStackSection
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)