pub(crate) fn table_init(
        &mut self,
        table_index: TableIndex,
        elem_index: ElemIndex,
        dst: u32,
        src: u32,
        len: u32,
    ) -> Result<(), Trap> {
        // TODO: this `clone()` shouldn't be necessary but is used for now to
        // inform `rustc` that the lifetime of the elements here are
        // disconnected from the lifetime of `self`.
        let module = self.module().clone();

        let elements = match module.passive_elements_map.get(&elem_index) {
            Some(index) if !self.dropped_elements.contains(elem_index) => {
                module.passive_elements[*index].as_ref()
            }
            _ => &[],
        };
        self.table_init_segment(table_index, elements, dst, src, len)
    }
/// The `table.init` operation: initializes a portion of a table with a
/// passive element.
///
/// # Errors
///
/// Returns a `Trap` error when the range within the table is out of bounds
/// or the range within the passive element is out of bounds.
The `table.init` operation: initializes a portion of a table with a
passive element.
The ` table . init ` operation : initializes a portion of a table with a passive element .
pub(crate) fn table_init(
        &mut self,
        table_index: TableIndex,
        elem_index: ElemIndex,
        dst: u32,
        src: u32,
        len: u32,
    ) -> Result<(), Trap> {
        // TODO: this `clone()` shouldn't be necessary but is used for now to
        // inform `rustc` that the lifetime of the elements here are
        // disconnected from the lifetime of `self`.
        let module = self.module().clone();
        let elements = match module.passive_elements_map.get(&elem_index) {
            Some(index) if !self.dropped_elements.contains(elem_index) => {
                module.passive_elements[*index].as_ref()
            }
            _ => &[],
        };
        self.table_init_segment(table_index, elements, dst, src, len)
    }
pub ( crate ) fn table_init ( & mut self , table_index : TableIndex , elem_index : ElemIndex , dst : u32 , src : u32 , len : u32 , ) -> Result < ( ) , Trap > { // TODO: this `clone()` shouldn't be necessary but is used for now to // inform `rustc` that the lifetime of the elements here are // disconnected from the lifetime of `self`. let module = self . module ( ) . clone ( ) ; let elements = match module . passive_elements_map . get ( & elem_index ) { Some ( index ) if ! self . dropped_elements . contains ( elem_index ) => { module . passive_elements [ * index ] . as_ref ( ) } _ => & [ ] , } ; self . table_init_segment ( table_index , elements , dst , src , len ) }
The `table.init` operation: initializes a portion of a table with a
passive element.
The ` table . init ` operation : initializes a portion of a table with a passive element .
&mut self
table_index
TableIndex
elem_index
ElemIndex
dst
u32
src
u32
len
u32
&mut self
table_index
TableIndex
elem_index
ElemIndex
dst
u32
src
u32
len
u32
errors
Returns a `Trap` error when the range within the table is out of bounds
or the range within the passive element is out of bounds.
Returns a ` Trap ` error when the range within the table is out of bounds or the range within the passive element is out of bounds .