Better wrapping with Rust

Trying to hide most of the CXX nastiness behind the actual module
Move the CXX ffi stuff to its own module
Separate mgr and module mods
Modify main.rs to use the basic code we have done so far
This commit is contained in:
Greg Hellings
2025-02-24 23:18:38 -06:00
parent 87fde0db10
commit 0c3e46497c
6 changed files with 121 additions and 68 deletions
+20
View File
@@ -0,0 +1,20 @@
use crate::cxx::ffi;
use cxx::UniquePtr;
pub struct Module {
module: UniquePtr<ffi::Module>,
}
impl Module {
pub fn new(module: UniquePtr<ffi::Module>) -> Self {
Self { module: module }
}
pub fn get_name(&self) -> String {
self.module.get_name()
}
pub fn strip_text(&mut self) -> String {
self.module.pin_mut().strip_text()
}
}