structs implementing Copy are scaffolded out.

todo: need an unsafe method for casting pointers in order to validate
contents via recursive descent
This commit is contained in:
Pat Hickey
2020-01-28 15:45:52 -08:00
parent 373560b88a
commit 62e00434b0
6 changed files with 113 additions and 6 deletions

View File

@@ -62,6 +62,11 @@ pub mod test {
println!("bat: {}", an_int);
Ok((an_int as f32) * 2.0)
}
fn sum_of_pair(&mut self, an_pair: &types::PairInts) -> Result<i64, types::Errno> {
println!("sum of pair: {:?}", an_pair);
Ok(an_pair.first as i64 + an_pair.second as i64)
}
}
// Errno is used as a first return value in the functions above, therefore
// it must implement GuestErrorType with type Context = WasiCtx.