@@ -135,6 +135,13 @@ pub trait BaseObject: IntoGEMObject {
self.gem_ref().size
}
+ /// Sets the exportable flag, which controls whether the object can be exported via PRIME.
+ fn set_exportable(&mut self, exportable: bool) {
+ // SAFETY: gem_obj() is valid per the type invariant, and this is safe to write if we
+ // are the only holder (mutable ref).
+ unsafe { (*self.gem_obj()).exportable = exportable };
+ }
+
/// Creates a new reference to the object.
fn reference(&self) -> ObjectRef<Self> {
// SAFETY: Having a reference to an Object implies holding a GEM reference