pub struct TypeData { /* private fields */ }
Expand description
Type-specific data that is filled in during type creation.
Implementations§
source§impl TypeData
impl TypeData
sourcepub fn parent_class(&self) -> gpointer
pub fn parent_class(&self) -> gpointer
Returns a pointer to the native parent class.
This is used for chaining up to the parent class’ implementation of virtual methods.
sourcepub fn parent_interface<I: IsInterface>(&self) -> gpointer
pub fn parent_interface<I: IsInterface>(&self) -> gpointer
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.
sourcepub fn class_data<T: Any + Send + Sync + 'static>(
&self,
type_: Type,
) -> Option<&T>
pub fn class_data<T: Any + Send + Sync + 'static>( &self, type_: Type, ) -> Option<&T>
Returns a pointer to the class implementation specific data.
This is used for class implementations to store additional data.
sourcepub unsafe fn class_data_mut<T: Any + Send + Sync + 'static>(
&mut self,
type_: Type,
) -> Option<&mut T>
pub unsafe fn class_data_mut<T: Any + Send + Sync + 'static>( &mut self, type_: Type, ) -> Option<&mut T>
Gets a mutable reference of the class implementation specific data.
§Safety
This can only be used while the type is being initialized.
sourcepub unsafe fn set_class_data<T: Any + Send + Sync + 'static>(
&mut self,
type_: Type,
data: T,
)
pub unsafe fn set_class_data<T: Any + Send + Sync + 'static>( &mut self, type_: Type, data: T, )
sourcepub 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.