Struct wasmtime_environ::wasm::wasmparser::GlobalSectionReader [−][src]
pub struct GlobalSectionReader<'a> { /* fields omitted */ }
Implementations
pub fn new(
data: &'a [u8],
offset: usize
) -> Result<GlobalSectionReader<'a>, BinaryReaderError>
[src]Reads content of the global section.
Examples
use wasmparser::GlobalSectionReader; let mut global_reader = GlobalSectionReader::new(data, 0).unwrap(); for _ in 0..global_reader.get_count() { let global = global_reader.read().expect("global"); println!("Global: {:?}", global); let mut init_expr_reader = global.init_expr.get_binary_reader(); let op = init_expr_reader.read_operator().expect("op"); println!("Init const: {:?}", op); }
Trait Implementations
type Item = Result<Global<'a>, BinaryReaderError>
type Item = Result<Global<'a>, BinaryReaderError>
The type of the elements being iterated over.
type IntoIter = SectionIteratorLimited<GlobalSectionReader<'a>>
type IntoIter = SectionIteratorLimited<GlobalSectionReader<'a>>
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
pub fn read(
&mut self
) -> Result<<GlobalSectionReader<'a> as SectionReader>::Item, BinaryReaderError>
[src]Auto Trait Implementations
impl<'a> RefUnwindSafe for GlobalSectionReader<'a>
impl<'a> Send for GlobalSectionReader<'a>
impl<'a> Sync for GlobalSectionReader<'a>
impl<'a> Unpin for GlobalSectionReader<'a>
impl<'a> UnwindSafe for GlobalSectionReader<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more