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:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user