bad news, ::safe_ffi, does not work with a function of an impl (&self)
#[ffi_export]
pub extern "C" fn hello_from_rust(&self) -> repr_c::Vec<Rect> {
println!("hello from rust");
let mut lst_rect = Vec::new();
let my_rect = Rect {
x : 0,
y : 0,
w : 128,
h : 82,
};
lst_rect.push(my_rect);
let my_rect = Rect {
x : 127,
y : 0,
w : 128,
h : 82,
};
lst_rect.push(my_rect);
println!("rect : {:?}",lst_rect);
lst_rect.into()
}
no rules expected the token `&`
--> src/lib.rs:102:22
|
102 | pub fn hello_from_rust(&self) -> repr_c::Vec<HxObject> {
| ^ no rules expected this token in macro call
error: aborting due to previous error