return values written to pointers!

This commit is contained in:
Pat Hickey
2020-01-27 12:40:54 -08:00
parent a20ef36a49
commit e6a4ae205c
4 changed files with 153 additions and 77 deletions

View File

@@ -62,8 +62,12 @@ pub mod test {
);
Ok(())
}
}
fn bat(&mut self, an_int: u32) -> Result<f32, types::Errno> {
println!("bat: {}", an_int);
Ok((an_int as f32) * 2.0)
}
}
// Errno is used as a first return value in the functions above, therefore
// it must implement GuestErrorType with type Context = WasiCtx.
// The context type should let you do logging or debugging or whatever you need