From 996289725d69c3b1a920fa596f762ab42f2c50c5 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 22 Oct 2021 11:44:54 -0700 Subject: [PATCH] docs --- crates/wasmtime/src/externals.rs | 10 ++++++++++ crates/wasmtime/src/memory.rs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/crates/wasmtime/src/externals.rs b/crates/wasmtime/src/externals.rs index 686b154472..d75b11c6c7 100644 --- a/crates/wasmtime/src/externals.rs +++ b/crates/wasmtime/src/externals.rs @@ -406,6 +406,12 @@ impl Table { /// Returns an error if `init` does not match the element type of the table, /// or if `init` does not belong to the `store` provided. /// + /// # Panics + /// + /// This function will panic when used with a [`Store`] which has a + /// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When + /// using an async resource limiter, use [`Table::new_async`] instead. + /// /// # Examples /// /// ``` @@ -570,6 +576,10 @@ impl Table { /// # Panics /// /// Panics if `store` does not own this table. + /// + /// This function will panic when used with a [`Store`] which has a + /// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When + /// using an async resource limiter, use [`Table::grow_async`] instead. pub fn grow(&self, mut store: impl AsContextMut, delta: u32, init: Val) -> Result { let store = store.as_context_mut().0; let ty = self.ty(&store).element().clone(); diff --git a/crates/wasmtime/src/memory.rs b/crates/wasmtime/src/memory.rs index 3f22f3dd2f..b01fa366b8 100644 --- a/crates/wasmtime/src/memory.rs +++ b/crates/wasmtime/src/memory.rs @@ -202,6 +202,12 @@ impl Memory { /// The `store` argument will be the owner of the returned [`Memory`]. All /// WebAssembly memory is initialized to zero. /// + /// # Panics + /// + /// This function will panic if the [`Store`] has a + /// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When + /// using an async resource limiter, use [`Memory::new_async`] instead. + /// /// # Examples /// /// ``` @@ -459,6 +465,10 @@ impl Memory { /// /// Panics if this memory doesn't belong to `store`. /// + /// This function will panic if the [`Store`] has a + /// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When + /// using an async resource limiter, use [`Memory::grow_async`] instead. + /// /// # Examples /// /// ```