Closed
Description
I realise it's not a great time to be asking a question give #172...
Is there a way to call a method on a UserData
(or indeed a Table
, or general Value
) from Rust?
My use case is that I want to wrap several Rust types as UserData
, which all implement the same trait. In some places I want to be able to pass any of the concrete types from Lua to a Rust function, which only cares that it implements the trait.
In my home-grown bindings I implemented this by adding as_<TRAIT>
methods I can call without knowing the type, which returned something like an Rc<RefCell<dyn TRAIT>>
which I could then use.
Metadata
Metadata
Assignees
Labels
No labels