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