Commit Graph

10 Commits

Author SHA1 Message Date
Alex Crichton
7b5176baea Upgrade all crates to the Rust 2021 edition (#3991)
* Upgrade all crates to the Rust 2021 edition

I've personally started using the new format strings for things like
`panic!("some message {foo}")` or similar and have been upgrading crates
on a case-by-case basis, but I think it probably makes more sense to go
ahead and blanket upgrade everything so 2021 features are always
available.

* Fix compile of the C API

* Fix a warning

* Fix another warning
2022-04-04 12:27:12 -05:00
Alex Crichton
b9985fe2e5 Change the injection count of fuel in a store from u32 to u64 (#3048)
* Change the injection count of fuel in a store from u32 to u64

This commit updates the type of the amount of times to inject fuel in
the `out_of_fuel_async_yield` to `u64` instead of `u32`. This should
allow effectively infinite fuel to get injected, even if a small amount
of fuel is injected per iteration.

Closes #2927
Closes #3046

* Fix tokio example
2021-07-01 10:46:21 -05:00
Alex Crichton
7a1b7cdf92 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.
2021-06-03 09:10:53 -05:00
Pat Hickey
0f5bdc6497 only wasi_cap_std_sync and wasi_tokio need to define WasiCtxBuilders (#2917)
* wasmtime-wasi: re-exporting this WasiCtxBuilder was shadowing the right one

wasi-common's WasiCtxBuilder is really only useful wasi_cap_std_sync and
wasi_tokio to implement their own Builder on top of.

This re-export of wasi-common's is 1. not useful and 2. shadow's the
re-export of the right one in sync::*.

* wasi-common: eliminate WasiCtxBuilder, make the builder methods on WasiCtx instead

* delete wasi-common::WasiCtxBuilder altogether

just put those methods directly on &mut WasiCtx.

As a bonus, the sync and tokio WasiCtxBuilder::build functions
are no longer fallible!

* bench fixes

* more test fixes
2021-05-21 12:59:39 -05:00
Pat Hickey
35a9d4e3c9 less general mechanism for examples cargo feature 2021-05-06 16:23:33 -07:00
Pat Hickey
3d9b98f1df fix example 2021-05-06 14:34:30 -07:00
Pat Hickey
b0335d3ddf fixes to example 2021-05-06 14:27:28 -07:00
Pat Hickey
2ddf4c1da9 tokio example requires enabling a cargo feature
and also a dummy C example
2021-04-14 16:54:52 -07:00
Pat Hickey
0127676621 wasi-cap-std-async is better named wasi-tokio 2021-04-14 14:06:36 -07:00
Pat Hickey
759019811e add tokio example
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2021-04-13 17:52:52 -07:00