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