Open ankur19030 opened 4 months ago
How to expose the function summarize to C++ via CXX ?
pub trait Summary { fn summarize(&self) -> String; } pub struct NewsArticle { pub headline: String, pub location: String, pub author: String, pub content: String, } impl Summary for NewsArticle { fn summarize(&self) -> String { format!("{}, by {} ({})", self.headline, self.author, self.location) } }
https://github.com/dtolnay/cxx/pull/672/files
This can probably help you. It's not the most graceful way, but it works.
How to expose the function summarize to C++ via CXX ?