Skip to main content

InputModule

Struct InputModule 

Source
pub struct InputModule<'a> {
Show 15 fields pub types: IdVec<FuncType>, pub imports: IdVec<Import<'a>>, pub exports: IdVec<Export<'a>>, pub tables: IdVec<Table<'a>>, pub elements: IdVec<Element<'a>>, pub tags: IdVec<TagType>, pub globals: IdVec<Global<'a>>, pub memories: IdVec<MemoryType>, pub code: IndexedSection<CodeSection<'a>>, pub data: IndexedSection<DataSection<'a>>, pub names: Names<'a>, pub linking: LinkingInfo<'a>, pub relocs: Relocation, pub target_features: TargetFeatures, pub custom_sections: VecMap<IndexedSection<CustomSection<'a>>>,
}
Expand description

Lossless representation of wasm module, without preprocessing That can pass round-trip test without any loss. After round-trip section will have canonical order.

Fields§

§types: IdVec<FuncType>§imports: IdVec<Import<'a>>§exports: IdVec<Export<'a>>§tables: IdVec<Table<'a>>§elements: IdVec<Element<'a>>§tags: IdVec<TagType>§globals: IdVec<Global<'a>>§memories: IdVec<MemoryType>§code: IndexedSection<CodeSection<'a>>§data: IndexedSection<DataSection<'a>>§names: Names<'a>§linking: LinkingInfo<'a>§relocs: Relocation§target_features: TargetFeatures§custom_sections: VecMap<IndexedSection<CustomSection<'a>>>

Implementations§

Source§

impl<'a> InputModule<'a>

Source

pub fn parse(wasm: &'a [u8]) -> Result<Self>

Source

pub fn defined_func_type_id( &self, id: Id<FunctionWithBody<'static>>, ) -> Id<FuncType>

Trait Implementations§

Source§

impl<'a> Default for InputModule<'a>

Source§

fn default() -> InputModule<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for InputModule<'a>

§

impl<'a> RefUnwindSafe for InputModule<'a>

§

impl<'a> Send for InputModule<'a>

§

impl<'a> Sync for InputModule<'a>

§

impl<'a> Unpin for InputModule<'a>

§

impl<'a> UnsafeUnpin for InputModule<'a>

§

impl<'a> UnwindSafe for InputModule<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.