pub struct TypeData { /* private fields */ }
Expand description
Type-specific data that is filled in during type creation.
Implementations§
§impl TypeData
impl TypeData
pub fn parent_class(&self) -> *mut c_void
pub fn parent_class(&self) -> *mut c_void
Returns a pointer to the native parent class.
This is used for chaining up to the parent class’ implementation of virtual methods.
pub fn parent_interface<I>(&self) -> *mut c_voidwhere
I: IsInterface,
pub fn parent_interface<I>(&self) -> *mut c_voidwhere I: IsInterface,
Returns a pointer to the native parent interface struct for interface type_
.
This is used for chaining up to the parent interface’s implementation of virtual methods.
Panics
This function panics if the type to which the TypeData
belongs does not implement the
given interface or was not registered yet.
pub fn class_data<T>(&self, type_: Type) -> Option<&T>where
T: Any + Send + Sync + 'static,
pub fn class_data<T>(&self, type_: Type) -> Option<&T>where T: Any + Send + Sync + 'static,
Returns a pointer to the class implementation specific data.
This is used for class implementations to store additional data.
pub unsafe fn class_data_mut<T>(&mut self, type_: Type) -> Option<&mut T>where
T: Any + Send + Sync + 'static,
pub unsafe fn class_data_mut<T>(&mut self, type_: Type) -> Option<&mut T>where T: Any + Send + Sync + 'static,
Gets a mutable reference of the class implementation specific data.
Safety
This can only be used while the type is being initialized.
pub unsafe fn set_class_data<T>(&mut self, type_: Type, data: T)where
T: Any + Send + Sync + 'static,
pub unsafe fn set_class_data<T>(&mut self, type_: Type, data: T)where T: Any + Send + Sync + 'static,
pub fn impl_offset(&self) -> isize
pub fn impl_offset(&self) -> isize
Returns the offset of the private implementation struct in bytes relative to the beginning of the instance struct.