Struct walrus::IdsToIndices
source · pub struct IdsToIndices { /* private fields */ }
Expand description
Maps our high-level identifiers to the raw indices they end up emitted at.
As we lower to raw wasm structures, we cement various constructs’ locations
in their respective index spaces. For example, a type with some id A
ends
up being the i^th
type emitted in the raw wasm type section. When a
function references that type, it needs to reference it by its i
index
since the identifier A
doesn’t exist at the raw wasm level.
Implementations§
source§impl IdsToIndices
impl IdsToIndices
sourcepub fn get_table_index(&self, id: TableId) -> u32
pub fn get_table_index(&self, id: TableId) -> u32
Get the index for the given identifier.
sourcepub fn get_type_index(&self, id: TypeId) -> u32
pub fn get_type_index(&self, id: TypeId) -> u32
Get the index for the given identifier.
sourcepub fn get_func_index(&self, id: FunctionId) -> u32
pub fn get_func_index(&self, id: FunctionId) -> u32
Get the index for the given identifier.
sourcepub fn get_global_index(&self, id: GlobalId) -> u32
pub fn get_global_index(&self, id: GlobalId) -> u32
Get the index for the given identifier.
sourcepub fn get_memory_index(&self, id: MemoryId) -> u32
pub fn get_memory_index(&self, id: MemoryId) -> u32
Get the index for the given identifier.
sourcepub fn get_element_index(&self, id: ElementId) -> u32
pub fn get_element_index(&self, id: ElementId) -> u32
Get the index for the given identifier.
source§impl IdsToIndices
impl IdsToIndices
sourcepub fn get_data_index(&self, id: DataId) -> u32
pub fn get_data_index(&self, id: DataId) -> u32
Get the index for the given identifier.
Trait Implementations§
source§impl Debug for IdsToIndices
impl Debug for IdsToIndices
source§impl Default for IdsToIndices
impl Default for IdsToIndices
source§fn default() -> IdsToIndices
fn default() -> IdsToIndices
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IdsToIndices
impl RefUnwindSafe for IdsToIndices
impl Send for IdsToIndices
impl Sync for IdsToIndices
impl Unpin for IdsToIndices
impl UnwindSafe for IdsToIndices
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