Macro rquickjs_core::class_def [−][src]
This is supported on crate feature
classes
only.The macro to simplify class definition.
struct TestClass; impl TestClass { fn method(&self) {} fn static_func() {} } class_def! { TestClass // optional prototype initializer (proto) { proto.set("method", Func::from(Method(TestClass::method)))?; } // optional static initializer @(ctor) { ctor.set("static_func", Func::from(TestClass::static_func))?; } // optional internal refs marker (for gc) ~(_self, _marker) { // mark internal refs if exists } }