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