Struct ScriptParser

Source
pub struct ScriptParser<F32 = f32, F64 = f64> { /* private fields */ }
Expand description

Parser which allows to parse WebAssembly script text format.

Implementations§

Source§

impl<F32: FromBits<u32>, F64: FromBits<u64>> ScriptParser<F32, F64>

Source

pub fn from_source_and_name( source: &[u8], test_filename: &str, ) -> Result<Self, Error>

Create ScriptParser from the script in specified file.

The source should contain valid wast.

The test_filename must have a .wast extension.

Source

pub fn from_source_and_name_with_features( source: &[u8], test_filename: &str, features: Features, ) -> Result<Self, Error>

Create ScriptParser from the script in specified file, parsing with the given features.

The source should contain valid wast.

The test_filename must have a .wast extension.

Source

pub fn from_str(source: &str) -> Result<Self, Error>

Create ScriptParser from the script source.

Source

pub fn next(&mut self) -> Result<Option<Command<F32, F64>>, Error>

Returns the next Command from the script.

Returns Err if an error occurred while parsing the script, or returns None if the parser reached end of script.

Auto Trait Implementations§

§

impl<F32, F64> Freeze for ScriptParser<F32, F64>

§

impl<F32, F64> RefUnwindSafe for ScriptParser<F32, F64>
where F32: RefUnwindSafe, F64: RefUnwindSafe,

§

impl<F32 = f32, F64 = f64> !Send for ScriptParser<F32, F64>

§

impl<F32 = f32, F64 = f64> !Sync for ScriptParser<F32, F64>

§

impl<F32, F64> Unpin for ScriptParser<F32, F64>
where F32: Unpin, F64: Unpin,

§

impl<F32, F64> UnwindSafe for ScriptParser<F32, F64>
where F32: UnwindSafe, F64: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromBits<T> for T

Source§

fn from_bits(other: T) -> T

Convert other to Self, preserving bitwise representation
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.