Creates a new WebAssembly memory given the configuration of `ty`. 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`](`crate::Store`) has a [`ResourceLimiterAsync`](`crate::ResourceLimiterAsync`) (see also: [`Store::limiter_async`](`crate::Store::limiter_async`)). When using an async
(mut store: impl AsContextMut, ty: MemoryType)
| 267 | /// memory allocation fails. See the `OutOfMemory` type's documentation for |
| 268 | /// details on Wasmtime's out-of-memory handling. |
| 269 | pub fn new(mut store: impl AsContextMut, ty: MemoryType) -> Result<Memory> { |
| 270 | let (mut limiter, store) = store |
| 271 | .as_context_mut() |
| 272 | .0 |
| 273 | .validate_sync_resource_limiter_and_store_opaque()?; |
| 274 | vm::assert_ready(Self::_new(store, limiter.as_mut(), ty)) |
| 275 | } |
| 276 | |
| 277 | /// Async variant of [`Memory::new`]. You must use this variant with |
| 278 | /// [`Store`](`crate::Store`)s which have a |
nothing calls this directly
no test coverage detected