Struct CustomSectionReader
pub struct CustomSectionReader<'a> { /* private fields */ }Expand description
A reader for custom sections of a WebAssembly module.
Implementations§
§impl<'a> CustomSectionReader<'a>
impl<'a> CustomSectionReader<'a>
pub fn new(
reader: BinaryReader<'a>,
) -> Result<CustomSectionReader<'a>, BinaryReaderError>
pub fn new( reader: BinaryReader<'a>, ) -> Result<CustomSectionReader<'a>, BinaryReaderError>
Constructs a new CustomSectionReader for the given data and offset.
pub fn data_offset(&self) -> usize
pub fn data_offset(&self) -> usize
The offset, relative to the start of the original module or component,
that the data payload for this custom section starts at.
pub fn range(&self) -> Range<usize> ⓘ
pub fn range(&self) -> Range<usize> ⓘ
The range of bytes that specify this whole custom section (including both the name of this custom section and its data) specified in offsets relative to the start of the byte stream.
pub fn as_known(&self) -> KnownCustom<'a>
pub fn as_known(&self) -> KnownCustom<'a>
Attempts to match and see if this custom section is statically known to
wasmparser with any known section reader.
This will inspect self.name() and return a KnownCustom if the name
matches a known custom section where there is a parser available for it.
This can also be used as a convenience function for creating such
parsers.
If the custom section name is not known, or if a reader could not be
created, then KnownCustom::Unknown is returned.
Trait Implementations§
§impl<'a> Clone for CustomSectionReader<'a>
impl<'a> Clone for CustomSectionReader<'a>
§fn clone(&self) -> CustomSectionReader<'a>
fn clone(&self) -> CustomSectionReader<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<'a> Debug for CustomSectionReader<'a>
impl<'a> Debug for CustomSectionReader<'a>
§impl<'a> From<CustomSectionReader<'a>> for CustomSection<'a>
impl<'a> From<CustomSectionReader<'a>> for CustomSection<'a>
§fn from(section: CustomSectionReader<'a>) -> CustomSection<'a>
fn from(section: CustomSectionReader<'a>) -> CustomSection<'a>
Auto Trait Implementations§
impl<'a> Freeze for CustomSectionReader<'a>
impl<'a> RefUnwindSafe for CustomSectionReader<'a>
impl<'a> Send for CustomSectionReader<'a>
impl<'a> Sync for CustomSectionReader<'a>
impl<'a> Unpin for CustomSectionReader<'a>
impl<'a> UnwindSafe for CustomSectionReader<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more