pub struct Parser { /* private fields */ }Expand description
A WebAssembly parser
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_options(options: ParserOptions) -> Self
pub fn with_options(options: ParserOptions) -> Self
Create a new parser with explicit options.
Sourcepub const fn options(&self) -> &ParserOptions
pub const fn options(&self) -> &ParserOptions
Read back parser options.
Sourcepub fn parse_module_bytes(
&self,
wasm: impl AsRef<[u8]>,
) -> Result<Module, ParseError>
pub fn parse_module_bytes( &self, wasm: impl AsRef<[u8]>, ) -> Result<Module, ParseError>
Parse a Module from bytes
Sourcepub fn parse_module_file(
&self,
path: impl AsRef<Path> + Clone,
) -> Result<Module, ParseError>
pub fn parse_module_file( &self, path: impl AsRef<Path> + Clone, ) -> Result<Module, ParseError>
Parse a Module from a file. Requires std feature.
Sourcepub fn parse_module_stream(
&self,
stream: impl Read,
) -> Result<Module, ParseError>
pub fn parse_module_stream( &self, stream: impl Read, ) -> Result<Module, ParseError>
Parse a Module from a stream. Requires std feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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