Struct cranelift_wasm::wasmparser::LinkingSectionReader
source · pub struct LinkingSectionReader<'a> { /* private fields */ }
Expand description
A reader for the linking
custom section of a WebAssembly module.
This format is currently defined upstream at https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md.
Implementations§
source§impl<'a> LinkingSectionReader<'a>
impl<'a> LinkingSectionReader<'a>
sourcepub fn new(
data: &'a [u8],
offset: usize
) -> Result<LinkingSectionReader<'a>, BinaryReaderError>
pub fn new( data: &'a [u8], offset: usize ) -> Result<LinkingSectionReader<'a>, BinaryReaderError>
Creates a new reader for the linking section contents starting at
offset
within the original wasm file.
sourcepub fn version(&self) -> u32
pub fn version(&self) -> u32
Returns the version of linking metadata contained in this section.
sourcepub fn original_position(&self) -> usize
pub fn original_position(&self) -> usize
Returns the original byte offset of this section.
sourcepub fn range(&self) -> Range<usize>
pub fn range(&self) -> Range<usize>
Returns the range, as byte offsets, of this section within the original wasm binary.
sourcepub fn subsections(&self) -> Subsections<'a, Linking<'a>> ⓘ
pub fn subsections(&self) -> Subsections<'a, Linking<'a>> ⓘ
Returns the iterator for advancing through the subsections.
You can also use IntoIterator::into_iter
directly on this type.
Trait Implementations§
source§impl<'a> Clone for LinkingSectionReader<'a>
impl<'a> Clone for LinkingSectionReader<'a>
source§fn clone(&self) -> LinkingSectionReader<'a>
fn clone(&self) -> LinkingSectionReader<'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> Debug for LinkingSectionReader<'a>
impl<'a> Debug for LinkingSectionReader<'a>
source§impl<'a> IntoIterator for LinkingSectionReader<'a>
impl<'a> IntoIterator for LinkingSectionReader<'a>
§type Item = Result<Linking<'a>, BinaryReaderError>
type Item = Result<Linking<'a>, BinaryReaderError>
The type of the elements being iterated over.
§type IntoIter = Subsections<'a, Linking<'a>>
type IntoIter = Subsections<'a, Linking<'a>>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <LinkingSectionReader<'a> as IntoIterator>::IntoIter
fn into_iter(self) -> <LinkingSectionReader<'a> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl<'a> Freeze for LinkingSectionReader<'a>
impl<'a> RefUnwindSafe for LinkingSectionReader<'a>
impl<'a> Send for LinkingSectionReader<'a>
impl<'a> Sync for LinkingSectionReader<'a>
impl<'a> Unpin for LinkingSectionReader<'a>
impl<'a> UnwindSafe for LinkingSectionReader<'a>
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