pub struct ElemIdx(u32);Tuple Fields§
§0: u32Implementations§
Source§impl ElemIdx
impl ElemIdx
Sourcepub unsafe fn decode_unchecked(wasm: &mut WasmDecoder<'_>) -> Self
pub unsafe fn decode_unchecked(wasm: &mut WasmDecoder<'_>) -> Self
Reads an element index from Wasm code without validating it.
§Safety
The caller must ensure that there is a valid element index in the WasmDecoder.
Source§impl ElemIdx
impl ElemIdx
Sourcepub fn validate<T>(
index: u32,
c_elems: &IdxVec<ElemIdx, T>,
) -> Result<Self, ValidationError>
pub fn validate<T>( index: u32, c_elems: &IdxVec<ElemIdx, T>, ) -> Result<Self, ValidationError>
Validates that a given index is a valid element index.
On success a new ElemIdx is returned, otherwise a
ValidationError is returned.
Sourcepub fn decode_and_validate<T>(
wasm: &mut WasmDecoder<'_>,
c_elems: &IdxVec<ElemIdx, T>,
) -> Result<Self, ValidationError>
pub fn decode_and_validate<T>( wasm: &mut WasmDecoder<'_>, c_elems: &IdxVec<ElemIdx, T>, ) -> Result<Self, ValidationError>
Reads an element index from Wasm code and validates that it is a valid index for a given elements vector.
Trait Implementations§
Source§impl Ord for ElemIdx
impl Ord for ElemIdx
Source§impl PartialOrd for ElemIdx
impl PartialOrd for ElemIdx
impl Copy for ElemIdx
impl Eq for ElemIdx
impl StructuralPartialEq for ElemIdx
Auto Trait Implementations§
impl Freeze for ElemIdx
impl RefUnwindSafe for ElemIdx
impl Send for ElemIdx
impl Sync for ElemIdx
impl Unpin for ElemIdx
impl UnwindSafe for ElemIdx
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