pub struct TinyWasmModule {
    pub version: Option<u16>,
    pub start_func: Option<u32>,
    pub funcs: Box<[(u32, WasmFunction)]>,
    pub func_types: Box<[FuncType]>,
    pub exports: Box<[Export]>,
    pub globals: Box<[Global]>,
    pub table_types: Box<[TableType]>,
    pub memory_types: Box<[MemoryType]>,
    pub imports: Box<[Import]>,
    pub data: Box<[Data]>,
    pub elements: Box<[Element]>,
}
Expand description

A TinyWasm WebAssembly Module

This is the internal representation of a WebAssembly module in TinyWasm. TinyWasmModules are validated before being created, so they are guaranteed to be valid (as long as they were created by TinyWasm). This means you should not trust a TinyWasmModule created by a third party to be valid.

Fields§

§version: Option<u16>

The version of the WebAssembly module.

§start_func: Option<u32>

The start function of the WebAssembly module.

§funcs: Box<[(u32, WasmFunction)]>

The functions of the WebAssembly module.

§func_types: Box<[FuncType]>

The types of the WebAssembly module.

§exports: Box<[Export]>

The exports of the WebAssembly module.

§globals: Box<[Global]>

The tables of the WebAssembly module.

§table_types: Box<[TableType]>

The tables of the WebAssembly module.

§memory_types: Box<[MemoryType]>

The memories of the WebAssembly module.

§imports: Box<[Import]>

The imports of the WebAssembly module.

§data: Box<[Data]>

Data segments of the WebAssembly module.

§elements: Box<[Element]>

Element segments of the WebAssembly module.

Trait Implementations§

source§

impl Clone for TinyWasmModule

source§

fn clone(&self) -> TinyWasmModule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyWasmModule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<&TinyWasmModule> for Module

source§

fn from(data: &TinyWasmModule) -> Self

Converts to this type from the input type.
source§

impl From<TinyWasmModule> for Module

source§

fn from(data: TinyWasmModule) -> Self

Converts to this type from the input type.
source§

impl TryFrom<ModuleReader> for TinyWasmModule

§

type Error = ParseError

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

fn try_from(reader: ModuleReader) -> Result<TinyWasmModule, ParseError>

Performs the conversion.

Auto Trait Implementations§

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, 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.