[][src]Struct walrus::IndicesToIds

pub struct IndicesToIds { /* fields omitted */ }

Maps from old indices in the original Wasm binary to walrus IDs.

This is intended to be used with walrus::Modules that were parsed from some existing Wasm binary. walrus::Modules that are built up from scratch, and not originally parsed from an existing Wasm binary, will have an empty IndicesToIds.

For example, this allows you to get the walrus::FunctionId of some Wasm function when you have its old index in the original Wasm module.

Any newly built or added things (functions, tables, types, etc) are not associated with an old index (since they were not present in the original Wasm binary).

Methods

impl IndicesToIds[src]

pub fn get_table(&self, index: u32) -> Result<TableId>[src]

Gets the ID for a particular index.

If the index did not exist in the original Wasm binary, an Err is returned.

impl IndicesToIds[src]

pub fn get_type(&self, index: u32) -> Result<TypeId>[src]

Gets the ID for a particular index.

If the index did not exist in the original Wasm binary, an Err is returned.

impl IndicesToIds[src]

pub fn get_func(&self, index: u32) -> Result<FunctionId>[src]

Gets the ID for a particular index.

If the index did not exist in the original Wasm binary, an Err is returned.

impl IndicesToIds[src]

pub fn get_global(&self, index: u32) -> Result<GlobalId>[src]

Gets the ID for a particular index.

If the index did not exist in the original Wasm binary, an Err is returned.

impl IndicesToIds[src]

pub fn get_memory(&self, index: u32) -> Result<MemoryId>[src]

Gets the ID for a particular index.

If the index did not exist in the original Wasm binary, an Err is returned.

impl IndicesToIds[src]

pub fn get_data(&self, index: u32) -> Result<DataId>[src]

Gets the ID for a particular index.

If the index did not exist in the original Wasm binary, an Err is returned.

impl IndicesToIds[src]

pub fn get_local(&self, function: FunctionId, index: u32) -> Result<LocalId>[src]

Gets the ID for a particular index

Trait Implementations

impl Default for IndicesToIds[src]

impl Debug for IndicesToIds[src]

Auto Trait Implementations

impl Sync for IndicesToIds

impl Send for IndicesToIds

impl Unpin for IndicesToIds

impl UnwindSafe for IndicesToIds

impl RefUnwindSafe for IndicesToIds

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]