Struct holochain_wasmer_host::prelude::wasmparser::MemorySectionReader [−]
pub struct MemorySectionReader<'a> { /* fields omitted */ }
Implementations
impl<'a> MemorySectionReader<'a>
impl<'a> MemorySectionReader<'a>
pub fn new(
data: &'a [u8],
offset: usize
) -> Result<MemorySectionReader<'a>, BinaryReaderError>
pub fn original_position(&self) -> usize
pub fn read(&mut self) -> Result<MemoryType, BinaryReaderError>
pub fn read(&mut self) -> Result<MemoryType, BinaryReaderError>
Reads content of the memory section.
Examples
use wasmparser::MemorySectionReader; let mut memory_reader = MemorySectionReader::new(data, 0).unwrap(); for _ in 0..memory_reader.get_count() { let memory = memory_reader.read().expect("memory"); println!("Memory: {:?}", memory); }
Trait Implementations
impl<'a> Clone for MemorySectionReader<'a>
impl<'a> Clone for MemorySectionReader<'a>
pub fn clone(&self) -> MemorySectionReader<'a>
pub fn clone(&self) -> MemorySectionReader<'a>
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl<'a> IntoIterator for MemorySectionReader<'a>
impl<'a> IntoIterator for MemorySectionReader<'a>
type Item = Result<MemoryType, BinaryReaderError>
type Item = Result<MemoryType, BinaryReaderError>
The type of the elements being iterated over.
type IntoIter = SectionIteratorLimited<MemorySectionReader<'a>>
type IntoIter = SectionIteratorLimited<MemorySectionReader<'a>>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <MemorySectionReader<'a> as IntoIterator>::IntoIter
pub fn into_iter(self) -> <MemorySectionReader<'a> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
impl<'a> SectionReader for MemorySectionReader<'a>
impl<'a> SectionReader for MemorySectionReader<'a>
type Item = MemoryType
pub fn read(
&mut self
) -> Result<<MemorySectionReader<'a> as SectionReader>::Item, BinaryReaderError>
pub fn original_position(&self) -> usize
fn ensure_end(&self) -> Result<(), BinaryReaderError>
impl<'a> SectionWithLimitedItems for MemorySectionReader<'a>
impl<'a> SectionWithLimitedItems for MemorySectionReader<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for MemorySectionReader<'a>
impl<'a> Send for MemorySectionReader<'a>
impl<'a> Sync for MemorySectionReader<'a>
impl<'a> Unpin for MemorySectionReader<'a>
impl<'a> UnwindSafe for MemorySectionReader<'a>
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more