pub struct Parser<'source> { /* private fields */ }
Expand description
A Web Assembly Value Encoding parser.
Implementations§
Source§impl<'source> Parser<'source>
impl<'source> Parser<'source>
Sourcepub fn with_lexer(lexer: Lexer<'source>) -> Self
pub fn with_lexer(lexer: Lexer<'source>) -> Self
Returns a new Parser with the given Lexer
.
Sourcepub fn parse_value<V: WasmValue>(
&mut self,
ty: &V::Type,
) -> Result<V, ParserError>
pub fn parse_value<V: WasmValue>( &mut self, ty: &V::Type, ) -> Result<V, ParserError>
Parses a WAVE-encoded value of the given crate::wasm::WasmType
into a
corresponding WasmValue
.
Sourcepub fn parse_raw_value(&mut self) -> Result<UntypedValue<'source>, ParserError>
pub fn parse_raw_value(&mut self) -> Result<UntypedValue<'source>, ParserError>
Parses a WAVE-encoded value into an UntypedValue
.
Sourcepub fn parse_raw_func_call(
&mut self,
) -> Result<UntypedFuncCall<'source>, ParserError>
pub fn parse_raw_func_call( &mut self, ) -> Result<UntypedFuncCall<'source>, ParserError>
Parses a function name followed by a WAVE-encoded, parenthesized,
comma-separated sequence of values into an UntypedFuncCall
.
Sourcepub fn finish(&mut self) -> Result<(), ParserError>
pub fn finish(&mut self) -> Result<(), ParserError>
Returns an error if any significant input remains unparsed.
Auto Trait Implementations§
impl<'source> Freeze for Parser<'source>
impl<'source> RefUnwindSafe for Parser<'source>
impl<'source> Send for Parser<'source>
impl<'source> Sync for Parser<'source>
impl<'source> Unpin for Parser<'source>
impl<'source> UnwindSafe for Parser<'source>
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