add a lifetime to the wiggle_runtime::GuestErrorType trait (#41)
* add a lifetime to the wiggle_runtime::GuestErrorType trait, wiggle_tests::WasiCtx struct * wiggle-generate: make config parsing public so it can be reused in lucet
This commit is contained in:
@@ -8,21 +8,21 @@ wiggle::from_witx!({
|
||||
|
||||
type Result<T> = std::result::Result<T, types::Errno>;
|
||||
|
||||
impl GuestErrorType for types::Errno {
|
||||
type Context = WasiCtx;
|
||||
impl<'a> GuestErrorType<'a> for types::Errno {
|
||||
type Context = WasiCtx<'a>;
|
||||
|
||||
fn success() -> types::Errno {
|
||||
types::Errno::Success
|
||||
}
|
||||
|
||||
fn from_error(e: GuestError, ctx: &WasiCtx) -> types::Errno {
|
||||
fn from_error(e: GuestError, ctx: &Self::Context) -> types::Errno {
|
||||
eprintln!("GUEST ERROR: {:?}", e);
|
||||
ctx.guest_errors.borrow_mut().push(e);
|
||||
types::Errno::Io
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx {
|
||||
impl<'a> crate::wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx<'a> {
|
||||
fn args_get(&self, _argv: GuestPtr<GuestPtr<u8>>, _argv_buf: GuestPtr<u8>) -> Result<()> {
|
||||
unimplemented!("args_get")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user