/// Grows the size of this table by `delta` more elements, initialization
/// all new elements to `init`.
///
/// Returns the previous size of this table if successful.
///
/// # Errors
///
/// Returns an error if the table cannot be grown by `delta`, for example
/// if it would cause the table to exceed its maximum size. Also returns an
/// error if `init` is not of the right type or if `init` does not belong to
/// `store`.
///
/// # Panics
///
/// Panics if `store` does not own this table.
Grows the size of this table by `delta` more elements, initialization
all new elements to `init`.

Returns the previous size of this table if successful.
Grows the size of this table by ` delta ` more elements initialization all new elements to ` init ` . Returns the previous size of this table if successful .
pub fn grow(&self, mut store: impl AsContextMut, delta: u32, init: Val) -> Result<u32> {
        let ty = self.ty(&store).element().clone();
        let init = init.into_table_element(&mut store.as_context_mut().opaque(), ty)?;
        let table = self.wasmtime_table(&mut store.as_context_mut().opaque());
        let store = store.as_context_mut();
        unsafe {
            match (*table).grow(delta, init, store.0.limiter()) {
                Some(size) => {
                    let vm = (*table).vmtable();
                    *store[self.0].definition = vm;
                    Ok(size)
                }
                None => bail!("failed to grow table by `{}`", delta),
            }
        }
    }
pub fn grow ( & self , mut store : impl AsContextMut , delta : u32 , init : Val ) -> Result < u32 > { let ty = self . ty ( & store ) . element ( ) . clone ( ) ; let init = init . into_table_element ( & mut store . as_context_mut ( ) . opaque ( ) , ty ) ? ; let table = self . wasmtime_table ( & mut store . as_context_mut ( ) . opaque ( ) ) ; let store = store . as_context_mut ( ) ; unsafe { match ( * table ) . grow ( delta , init , store . 0 . limiter ( ) ) { Some ( size ) => { let vm = ( * table ) . vmtable ( ) ; * store [ self . 0 ] . definition = vm ; Ok ( size ) } None => bail ! ( " " delta ) , } } }
Grows the size of this table by `delta` more elements, initialization
all new elements to `init`.
Grows the size of this table by ` delta ` more elements initialization all new elements to ` init ` .
&self
store
impl AsContextMut
delta
u32
init
Val
errors
Returns an error if the table cannot be grown by `delta`, for example
if it would cause the table to exceed its maximum size. Also returns an
error if `init` is not of the right type or if `init` does not belong to
`store`.
Returns an error if the table cannot be grown by ` delta ` for example if it would cause the table to exceed its maximum size . Also returns an error if ` init ` is not of the right type or if ` init ` does not belong to ` store ` .
panics
Panics if `store` does not own this table.
Panics if ` store ` does not own this table .