pub struct ElemIdx(u32);Tuple Fields§
§0: u32Implementations§
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 read_and_validate<T>(
wasm: &mut WasmReader<'_>,
c_elems: &IdxVec<ElemIdx, T>,
) -> Result<Self, ValidationError>
pub fn read_and_validate<T>( wasm: &mut WasmReader<'_>, 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.
Sourcepub unsafe fn read_unchecked(wasm: &mut WasmReader<'_>) -> Self
pub unsafe fn read_unchecked(wasm: &mut WasmReader<'_>) -> 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
WasmReader and that this index is valid for a specific IdxVec
through Self::read_and_validate or Self::validate.
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