Support calling Rust methods from C++
These methods can be declared in the bridge by naming the first
argument self and making it a reference to the containing class, e.g.,
fn get(self: &R) -> usize;
fn set(self: &mut R, n: usize);
This syntax requires Rust 1.43.
diff --git a/demo-cxx/demo.cc b/demo-cxx/demo.cc
index 6fc2465..bc0d976 100644
--- a/demo-cxx/demo.cc
+++ b/demo-cxx/demo.cc
@@ -18,7 +18,10 @@
return std::unique_ptr<ThingC>(new ThingC(std::string(appname)));
}
-void do_thing(SharedThing state) { print_r(*state.y); }
+void do_thing(SharedThing state) {
+ print_r(*state.y);
+ state.y->print();
+}
} // namespace example
} // namespace org