alexcrichton opened PR #1290 from rewrite-func to master:
This commit is a continuation of #1237 and updates the API of
Functo
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*family of functions was condensed into one
Func::wrapfunction.The ABI layer of conversions in
WasmTywere removed- An optional
Caller<'_>argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCallertype. TheCallertype has a
get_exportmethod on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
alexcrichton updated PR #1290 from rewrite-func to master:
This commit is a continuation of #1237 and updates the API of
Functo
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*family of functions was condensed into one
Func::wrapfunction.The ABI layer of conversions in
WasmTywere removed- An optional
Caller<'_>argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCallertype. TheCallertype has a
get_exportmethod on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
alexcrichton requested sunfishcode for a review on PR #1290.
alexcrichton updated PR #1290 from rewrite-func to master:
This commit is a continuation of #1237 and updates the API of
Functo
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*family of functions was condensed into one
Func::wrapfunction.The ABI layer of conversions in
WasmTywere removed- An optional
Caller<'_>argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCallertype. TheCallertype has a
get_exportmethod on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
sunfishcode submitted PR Review.
sunfishcode submitted PR Review.
sunfishcode created PR Review Comment:
It feels like this paragraph belongs on the
structrather than on theget_exportmethod.
sunfishcode created PR Review Comment:
It'd be good to mention somewhere that this is intended to be a temporary mechanism, and that we're hoping interface types will provide better ways to do this in the future.
alexcrichton updated PR #1290 from rewrite-func to master:
This commit is a continuation of #1237 and updates the API of
Functo
allow defining host functions which have easy access to a caller's
memory in particular. The new APIs look like so:
The
Func::wrap*family of functions was condensed into one
Func::wrapfunction.The ABI layer of conversions in
WasmTywere removed- An optional
Caller<'_>argument can be at the front of all
host-defined functions now.The old way the wasi bindings looked up memory has been removed and is
now replaced with theCallertype. TheCallertype has a
get_exportmethod on it which allows looking up a caller's export by
name, allowing you to get access to the caller's memory easily, and even
during instantiation.
sunfishcode submitted PR Review.
alexcrichton merged PR #1290.
Last updated: Dec 06 2025 at 06:05 UTC