Improve AbstractRefWrapper generation
MODIFY
binding-generator/src/writer/rust_native/abstract_ref_wrapper.rs
binding-generator/src/writer/rust_native/abstract_ref_wrapper.rs
use maplit::hashmap;
use once_cell::sync::Lazy;
-use crate::type_ref::{Constness, ConstnessOverride, ExternDir, NameStyle};
+use crate::type_ref::{Constness, NameStyle};
use crate::{AbstractRefWrapper, CompiledInterpolation, StrExt};
use super::RustNativeGeneratedElement;
@@ -26,8 +26,6 @@ impl RustNativeGeneratedElement for AbstractRefWrapper<'_, '_> {
"rust_full" => cls.rust_trait_name(NameStyle::ref_(), Constness::Mut),
"rust_const_full" => cls.rust_trait_name(NameStyle::ref_(), Constness::Const),
"rust_local" => type_ref.rust_name(NameStyle::decl()),
- "rust_extern_mut" => type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Mut)),
- "rust_extern_const" => type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Const)),
})
}
}

MODIFY
binding-generator/src/writer/rust_native/tpl/abstract_ref_wrapper/rust.tpl.rs
binding-generator/src/writer/rust_native/tpl/abstract_ref_wrapper/rust.tpl.rs
impl {{rust_const_full}} for types::AbstractRefMut<'static, dyn {{rust_full}}> {
- #[inline] fn as_raw_{{rust_local}}(&self) -> {{rust_extern_const}} { self.as_raw() }
+ #[inline] fn as_raw_{{rust_local}}(&self) -> extern_send!(Self) { self.as_raw() }
}
impl {{rust_full}} for types::AbstractRefMut<'static, dyn {{rust_full}}> {
- #[inline] fn as_raw_mut_{{rust_local}}(&mut self) -> {{rust_extern_mut}} { self.as_raw_mut() }
+ #[inline] fn as_raw_mut_{{rust_local}}(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() }
}

Improve AbstractRefWrapper generation