Implement RFC 11: Redesigning Wasmtime's APIs (#2897)
Implement Wasmtime's new API as designed by RFC 11. This is quite a large commit which has had lots of discussion externally, so for more information it's best to read the RFC thread and the PR thread.
This commit is contained in:
@@ -10,7 +10,7 @@ wiggle::from_witx!({
|
||||
impl_errno!(types::Errno);
|
||||
|
||||
impl<'a> ints::Ints for WasiCtx<'a> {
|
||||
fn cookie_cutter(&self, init_cookie: types::Cookie) -> Result<types::Bool, types::Errno> {
|
||||
fn cookie_cutter(&mut self, init_cookie: types::Cookie) -> Result<types::Bool, types::Errno> {
|
||||
let res = if init_cookie == types::COOKIE_START {
|
||||
types::Bool::True
|
||||
} else {
|
||||
@@ -43,11 +43,11 @@ impl CookieCutterExercise {
|
||||
}
|
||||
|
||||
pub fn test(&self) {
|
||||
let ctx = WasiCtx::new();
|
||||
let mut ctx = WasiCtx::new();
|
||||
let host_memory = HostMemory::new();
|
||||
|
||||
let res = ints::cookie_cutter(
|
||||
&ctx,
|
||||
&mut ctx,
|
||||
&host_memory,
|
||||
self.cookie as i64,
|
||||
self.return_ptr_loc.ptr as i32,
|
||||
|
||||
Reference in New Issue
Block a user