You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in extism calling plugin functions can only take a single argument.
I'd like macros like typed_plugin and plugin_fn to support multiple arguments, they would just convert them to use tuples under the hood.
IMO this could be implemented through ToBytes and FromBytes for Tuples where the individual fields implement those types.
This implementation could work as follows:
() already does
(T,) can just delegate to T
(T1, T2, ...) add one extra usize (could possibly be a different integer type) per item. The memory layout of the bytes array produced by tuples would need to be <T1::to_bytes().len()> <T1::to_bytes()> <T2::to_bytes().len()> <T2::to_bytes()> ....
I'd imagine this would work quite well for rust, but I'm uncertain for other languages, e.g., such without an actual tuple type.
The text was updated successfully, but these errors were encountered:
Currently, in
extism
calling plugin functions can only take a single argument.I'd like macros like
typed_plugin
andplugin_fn
to support multiple arguments, they would just convert them to use tuples under the hood.IMO this could be implemented through
ToBytes
andFromBytes
for Tuples where the individual fields implement those types.This implementation could work as follows:
()
already does(T,)
can just delegate to T(T1, T2, ...)
add one extrausize
(could possibly be a different integer type) per item. The memory layout of the bytes array produced by tuples would need to be<T1::to_bytes().len()> <T1::to_bytes()> <T2::to_bytes().len()> <T2::to_bytes()> ...
.I'd imagine this would work quite well for rust, but I'm uncertain for other languages, e.g., such without an actual tuple type.
The text was updated successfully, but these errors were encountered: