Returns this memory as a native Rust slice. Note that this method will consider the entire store context provided as borrowed for the duration of the lifetime of the returned slice. # Panics Panics if this memory doesn't belong to `store`.
(&self, store: impl Into<StoreContext<'a, T>>)
| 406 | /// |
| 407 | /// Panics if this memory doesn't belong to `store`. |
| 408 | pub fn data<'a, T: 'static>(&self, store: impl Into<StoreContext<'a, T>>) -> &'a [u8] { |
| 409 | unsafe { |
| 410 | let store = store.into(); |
| 411 | let definition = store[self.instance].memory(self.index); |
| 412 | debug_assert!(!self.ty(store).is_shared()); |
| 413 | slice::from_raw_parts(definition.base.as_ptr(), definition.current_length()) |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | /// Returns this memory as a native Rust mutable slice. |
| 418 | /// |
no test coverage detected