Update documentation
diff --git a/README.md b/README.md
index f51a1ac..3f7399a 100644
--- a/README.md
+++ b/README.md
@@ -84,8 +84,10 @@
// Functions implemented in C++.
fn make_demo(appname: &str) -> UniquePtr<ThingC>;
- fn get_name(thing: &ThingC) -> &CxxString;
fn do_thing(state: SharedThing);
+
+ // Methods implemented in C++.
+ fn get_name(self: &ThingC) -> &CxxString;
}
extern "Rust" {
@@ -95,6 +97,9 @@
// Functions implemented in Rust.
fn print_r(r: &ThingR);
+
+ // Methods implemented in Rust.
+ fn print(self: &ThingR);
}
}
```
@@ -335,8 +340,6 @@
to collect feedback on the direction and invite collaborators. Here are some of
the facets that I still intend for this project to tackle:
-- [ ] Support associated methods: `extern "Rust" { fn f(self: &Struct); }`
-- [ ] Support C++ member functions
- [ ] Support structs with type parameters
- [ ] Support async functions
diff --git a/src/lib.rs b/src/lib.rs
index 609db59..780a26e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -79,8 +79,10 @@
//!
//! // Functions implemented in C++.
//! fn make_demo(appname: &str) -> UniquePtr<ThingC>;
-//! fn get_name(thing: &ThingC) -> &CxxString;
//! fn do_thing(state: SharedThing);
+//!
+//! // Methods implemented in C++.
+//! fn get_name(self: &ThingC) -> &CxxString;
//! }
//!
//! extern "Rust" {
@@ -90,6 +92,9 @@
//!
//! // Functions implemented in Rust.
//! fn print_r(r: &ThingR);
+//!
+//! // Methods implemented in Rust.
+//! fn print(self: &ThingR);
//! }
//! }
//! #
@@ -99,6 +104,12 @@
//! # println!("called back with r={}", r.0);
//! # }
//! #
+//! # impl ThingR {
+//! # fn print(&self) {
+//! # println!("method called back with r={}", self.0);
+//! # }
+//! # }
+//! #
//! # fn main() {}
//! ```
//!