664f7d38e0a81597d83fd7805b752452dc7339c0
* Add first pass at GuestArray * Return &'a [T] instead of Vec<Refs> Also, add a sanity test for `GuestArray`. * Change approach in GuestArray::as_ref The new approach should avoid unnecessary copying (does it?) by iterating through the memory and firstly validating the guest pointers, to then extracting the slice `&'a [T]` using the unsafe `slice::from_raw_parts` fn. * Redo implementation of GuestArray and GuestArrayMut This commit: * redos the impl of `as_ref` and `as_ref_mut` for `GuestArray` and `GuestArrayMut` structs in that they now return dynamically borrow checked `GuestArrayRef` and `GuestArrayRefMut` structs * introduces `GuestArrayRef` and `GuestArrayRefMut` structs which perform dynamic borrow-checking of memory region at runtime, and can be derefed to `&[T]` and `&mut [T]` * adds a few sanity checks for the introduced types * Rename r#ref to ref_ * Add constructors for GuestArray and GuestArrayMut This commit: * adds constructors for `GuestArray` and `GuestArrayMut` both of which can now *only* be constructed from `GuestPtr::array` and `GuestPtrMut::array_mut` respectively * changes `Region::extend` to extend the region by adding to the current `len` (avoids problem of asserting for > 0) * implements `fmt::Debug` for most of memory types for easier testing (implementation is *not* enforced on the generic parameter `T` in the struct; rather, if `T` impls `fmt::Debug` then so does the memory type such as `GuestPtr<'_, T>`)
wiggle
An experimental implementation of bytecodealliance/wig crate which
generates Rust bindings from *.witx that are meant to be more idiomatic
and hopefully allowing for easier polyfilling between different WASI
snapshot versions in the future.
Description
Languages
Rust
77.8%
WebAssembly
20.6%
C
1.3%