[−][src]Trait glib::object::IsClassFor
Trait for mapping a class struct type to its corresponding instance type.
Associated Types
type Instance: ObjectType
Corresponding Rust instance type for this class.
Provided methods
fn get_type(&self) -> Type
Get the type id for this class.
fn upcast_ref<U: IsClassFor>(&self) -> &U where
Self::Instance: IsA<U::Instance>,
U::Instance: ObjectType,
Self::Instance: IsA<U::Instance>,
U::Instance: ObjectType,
Casts this class to a reference to a parent type's class.
fn upcast_ref_mut<U: IsClassFor>(&mut self) -> &mut U where
Self::Instance: IsA<U::Instance>,
U::Instance: ObjectType,
Self::Instance: IsA<U::Instance>,
U::Instance: ObjectType,
Casts this class to a mutable reference to a parent type's class.
fn downcast_ref<U: IsClassFor>(&self) -> Option<&U> where
U::Instance: IsA<Self::Instance>,
Self::Instance: ObjectType,
U::Instance: IsA<Self::Instance>,
Self::Instance: ObjectType,
Casts this class to a reference to a child type's class or fails if this class is not implementing the child class.
fn downcast_ref_mut<U: IsClassFor>(&mut self) -> Option<&mut U> where
U::Instance: IsA<Self::Instance>,
Self::Instance: ObjectType,
U::Instance: IsA<Self::Instance>,
Self::Instance: ObjectType,
Casts this class to a mutable reference to a child type's class or fails if this class is not implementing the child class.
fn from_type(type_: Type) -> Option<ClassRef<Self>>
Gets the class struct corresponding to type_
.
This will return None
if type_
is not a subclass of Self
.