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