Struct Parser
pub struct Parser<'source> { /* private fields */ }
Expand description
A Web Assembly Value Encoding parser.
Implementations§
§impl<'source> Parser<'source>
impl<'source> Parser<'source>
pub fn with_lexer(lexer: Lexer<'source, Token>) -> Parser<'source>
pub fn with_lexer(lexer: Lexer<'source, Token>) -> Parser<'source>
Returns a new Parser with the given Lexer
.
pub fn parse_value<V>(
&mut self,
ty: &<V as WasmValue>::Type,
) -> Result<V, ParserError>where
V: WasmValue,
pub fn parse_value<V>(
&mut self,
ty: &<V as WasmValue>::Type,
) -> Result<V, ParserError>where
V: WasmValue,
Parses a WAVE-encoded value of the given crate::wasm::WasmType
into a
corresponding WasmValue
.
pub 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
.
pub 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
.
pub 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
§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> ⓘ
Converts
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> ⓘ
Converts
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