Struct glib::subclass::basic::ClassStruct
source · #[repr(C)]pub struct ClassStruct<T: ObjectSubclass> { /* private fields */ }
Expand description
A basic class struct that does not store any additional data or virtual methods.
Methods from Deref<Target = Class<<T as ObjectSubclass>::Type>>§
sourcepub fn type_(&self) -> Type
pub fn type_(&self) -> Type
Get the type id for this class.
This is not equivalent to T::static_type()
but is the type of the subclass of T
where
this class belongs to.
sourcepub fn upcast_ref<U: IsClass>(&self) -> &Class<U>where
T: IsA<U>,
pub fn upcast_ref<U: IsClass>(&self) -> &Class<U>where
T: IsA<U>,
Casts this class to a reference to a parent type’s class.
sourcepub fn upcast_ref_mut<U: IsClass>(&mut self) -> &mut Class<U>where
T: IsA<U>,
pub fn upcast_ref_mut<U: IsClass>(&mut self) -> &mut Class<U>where
T: IsA<U>,
Casts this class to a mutable reference to a parent type’s class.
sourcepub fn downcast_ref<U: IsClass + IsA<T>>(&self) -> Option<&Class<U>>
pub fn downcast_ref<U: IsClass + IsA<T>>(&self) -> Option<&Class<U>>
Casts this class to a reference to a child type’s class or fails if this class is not implementing the child class.
Trait Implementations§
source§impl<T: ObjectSubclass> ClassStruct for ClassStruct<T>
impl<T: ObjectSubclass> ClassStruct for ClassStruct<T>
source§impl<T: ObjectSubclass> Debug for ClassStruct<T>
impl<T: ObjectSubclass> Debug for ClassStruct<T>
source§impl<T: ObjectSubclass> Deref for ClassStruct<T>
impl<T: ObjectSubclass> Deref for ClassStruct<T>
source§impl<T: ObjectSubclass> DerefMut for ClassStruct<T>
impl<T: ObjectSubclass> DerefMut for ClassStruct<T>
Auto Trait Implementations§
impl<T> Freeze for ClassStruct<T>
impl<T> RefUnwindSafe for ClassStruct<T>
impl<T> Send for ClassStruct<T>
impl<T> Sync for ClassStruct<T>
impl<T> Unpin for ClassStruct<T>
impl<T> UnwindSafe for ClassStruct<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more