DelSkayn / rquickjs

High level bindings to the quickjs javascript engine
MIT License
434 stars 59 forks source link

rust function with variable number of params #260

Closed FlondorDev closed 4 months ago

FlondorDev commented 4 months ago

hi, how do i create a function that can accept multiple params?

DelSkayn commented 4 months ago

That depends on how you want accept the params. If you want a single optional argument use Opt. If you want to accept all remaining arguments use Rest. If your requirement is more complex you will have to manually implement FromParams for a custom type.

FlondorDev commented 4 months ago

ok, thanks i was searching for Rest.