pub struct ComponentFunctionSectionReader<'a> { /* private fields */ }
Expand description
A reader for the function section of a WebAssembly component.
Implementations§
source§impl<'a> ComponentFunctionSectionReader<'a>
impl<'a> ComponentFunctionSectionReader<'a>
sourcepub fn new(data: &'a [u8], offset: usize) -> Result<Self>
pub fn new(data: &'a [u8], offset: usize) -> Result<Self>
Constructs a new ComponentFunctionSectionReader
for the given data and offset.
sourcepub fn original_position(&self) -> usize
pub fn original_position(&self) -> usize
Gets the original position of the section reader.
sourcepub fn read(&mut self) -> Result<ComponentFunction>
pub fn read(&mut self) -> Result<ComponentFunction>
Reads function type index from the function section.
Examples
use wasmparser::ComponentFunctionSectionReader;
let mut reader = ComponentFunctionSectionReader::new(data, 0).unwrap();
for _ in 0..reader.get_count() {
let func = reader.read().expect("func");
println!("Function: {:?}", func);
}
Trait Implementations§
source§impl<'a> Clone for ComponentFunctionSectionReader<'a>
impl<'a> Clone for ComponentFunctionSectionReader<'a>
source§fn clone(&self) -> ComponentFunctionSectionReader<'a>
fn clone(&self) -> ComponentFunctionSectionReader<'a>
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<'a> IntoIterator for ComponentFunctionSectionReader<'a>
impl<'a> IntoIterator for ComponentFunctionSectionReader<'a>
§type Item = Result<ComponentFunction, BinaryReaderError>
type Item = Result<ComponentFunction, BinaryReaderError>
The type of the elements being iterated over.
§type IntoIter = SectionIteratorLimited<ComponentFunctionSectionReader<'a>>
type IntoIter = SectionIteratorLimited<ComponentFunctionSectionReader<'a>>
Which kind of iterator are we turning this into?
source§impl<'a> SectionReader for ComponentFunctionSectionReader<'a>
impl<'a> SectionReader for ComponentFunctionSectionReader<'a>
§type Item = ComponentFunction
type Item = ComponentFunction
The item returned by the reader.
source§fn original_position(&self) -> usize
fn original_position(&self) -> usize
Gets the original position of the reader.