pub enum Index<'a> {
Num(u32, Span),
Id(Id<'a>),
}
Expand description
A reference to another item in a wasm module.
This type is used for items referring to other items (such as call $foo
referencing function $foo
). References can be either an index (u32) or an
Id
in the textual format.
The emission phase of a module will ensure that Index::Id
is never used
and switch them all to Index::Num
.
Variants§
Num(u32, Span)
A numerical index that this references. The index space this is
referencing is implicit based on where this Index
is stored.
Id(Id<'a>)
A human-readable identifier this references. Like Num
, the namespace
this references is based on where this is stored.
Implementations§
Trait Implementations§
source§impl Peek for Index<'_>
impl Peek for Index<'_>
impl<'a> Copy for Index<'a>
impl Eq for Index<'_>
Auto Trait Implementations§
impl<'a> Freeze for Index<'a>
impl<'a> RefUnwindSafe for Index<'a>
impl<'a> Send for Index<'a>
impl<'a> Sync for Index<'a>
impl<'a> Unpin for Index<'a>
impl<'a> UnwindSafe for Index<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.