Struct Class
pub struct Class<T>(/* private fields */)
where
T: IsClass;Expand description
Class struct of type T.
Implementations§
§impl<T> Class<T>where
T: IsClass,
impl<T> Class<T>where
T: IsClass,
pub 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.
pub fn upcast_ref<U>(&self) -> &Class<U>
pub fn upcast_ref<U>(&self) -> &Class<U>
Casts this class to a reference to a parent type’s class.
pub fn upcast_ref_mut<U>(&mut self) -> &mut Class<U>
pub fn upcast_ref_mut<U>(&mut self) -> &mut Class<U>
Casts this class to a mutable reference to a parent type’s class.
pub fn downcast_ref<U>(&self) -> Option<&Class<U>>
pub fn downcast_ref<U>(&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.
pub fn downcast_ref_mut<U>(&mut self) -> Option<&mut Class<U>>
pub fn downcast_ref_mut<U>(&mut self) -> Option<&mut Class<U>>
Casts this class to a mutable reference to a child type’s class or fails if this class is not implementing the child class.
Trait Implementations§
§impl<T> AsMut<<T as ObjectType>::GlibClassType> for Class<T>where
T: IsClass,
impl<T> AsMut<<T as ObjectType>::GlibClassType> for Class<T>where
T: IsClass,
§fn as_mut(&mut self) -> &mut <T as ObjectType>::GlibClassType
fn as_mut(&mut self) -> &mut <T as ObjectType>::GlibClassType
Converts this type into a mutable reference of the (usually inferred) input type.
§impl<T> AsRef<<T as ObjectType>::GlibClassType> for Class<T>where
T: IsClass,
impl<T> AsRef<<T as ObjectType>::GlibClassType> for Class<T>where
T: IsClass,
§fn as_ref(&self) -> &<T as ObjectType>::GlibClassType
fn as_ref(&self) -> &<T as ObjectType>::GlibClassType
Converts this type into a shared reference of the (usually inferred) input type.
§impl<T> Deref for Class<T>where
T: ParentClassIs,
impl<T> Deref for Class<T>where
T: ParentClassIs,
§impl<T> DerefMut for Class<T>where
T: ParentClassIs,
impl<T> DerefMut for Class<T>where
T: ParentClassIs,
§impl<T> ObjectClassExt for Class<T>where
T: ObjectType + IsClass,
impl<T> ObjectClassExt for Class<T>where
T: ObjectType + IsClass,
§fn has_property(&self, property_name: &str) -> bool
fn has_property(&self, property_name: &str) -> bool
Check if the object class has a property
property_name of the given type_.§fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
Check if the object class has a property
property_name of the given type_
or a subtype of it.§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
Get the type of the property
property_name of this object class. Read more§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
Get the
ParamSpec of the property property_name of this object class.§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
Return all
ParamSpec of the properties of this object class.§impl ObjectClassSubclassExt for Class<Object>
impl ObjectClassSubclassExt for Class<Object>
fn override_signal_class_handler<F>(&mut self, name: &str, class_handler: F)
impl<T> Send for Class<T>where
T: IsClass,
impl<T> Sync for Class<T>where
T: IsClass,
Auto Trait Implementations§
impl<T> Freeze for Class<T>
impl<T> RefUnwindSafe for Class<T>
impl<T> Unpin for Class<T>
impl<T> UnwindSafe for Class<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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)§impl<T> WidgetRef for Twhere
T: AsRef<Widget>,
impl<T> WidgetRef for Twhere
T: AsRef<Widget>,
§fn widget_ref(&self) -> &Widget
fn widget_ref(&self) -> &Widget
Returns a reference to a widget. Read more