The idea is to be able to call a method defined in Rust from JS. Not sure that's easy to implement. Maybe with https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy