pub trait ObjectExt: ObjectType {
Show 23 methods
// Required methods
fn is<T: StaticType>(&self) -> bool;
fn get_type(&self) -> Type;
fn get_object_class(&self) -> &ObjectClass;
fn set_property<'a, N: Into<&'a str>>(
&self,
property_name: N,
value: &dyn ToValue,
) -> Result<(), BoolError>;
fn get_property<'a, N: Into<&'a str>>(
&self,
property_name: N,
) -> Result<Value, BoolError>;
fn has_property<'a, N: Into<&'a str>>(
&self,
property_name: N,
type_: Option<Type>,
) -> Result<(), BoolError>;
fn get_property_type<'a, N: Into<&'a str>>(
&self,
property_name: N,
) -> Option<Type>;
fn find_property<'a, N: Into<&'a str>>(
&self,
property_name: N,
) -> Option<ParamSpec>;
fn list_properties(&self) -> Vec<ParamSpec>;
fn block_signal(&self, handler_id: &SignalHandlerId);
fn unblock_signal(&self, handler_id: &SignalHandlerId);
fn stop_signal_emission(&self, signal_name: &str);
fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F,
) -> Result<SignalHandlerId, BoolError>
where N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static;
unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F,
) -> Result<SignalHandlerId, BoolError>
where N: Into<&'a str>,
F: Fn(&[Value]) -> Option<Value>;
fn emit<'a, N: Into<&'a str>>(
&self,
signal_name: N,
args: &[&dyn ToValue],
) -> Result<Option<Value>, BoolError>;
fn disconnect(&self, handler_id: SignalHandlerId);
fn connect_notify<F: Fn(&Self, &ParamSpec) + Send + Sync + 'static>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId;
unsafe fn connect_notify_unsafe<F: Fn(&Self, &ParamSpec)>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId;
fn notify<'a, N: Into<&'a str>>(&self, property_name: N);
fn notify_by_pspec(&self, pspec: &ParamSpec);
fn downgrade(&self) -> WeakRef<Self>;
fn bind_property<'a, O: ObjectType, N: Into<&'a str>, M: Into<&'a str>>(
&'a self,
source_property: N,
target: &'a O,
target_property: M,
) -> BindingBuilder<'a>;
fn ref_count(&self) -> u32;
}
Required Methods§
Sourcefn is<T: StaticType>(&self) -> bool
fn is<T: StaticType>(&self) -> bool
Returns true
if the object is an instance of (can be cast to) T
.
fn get_type(&self) -> Type
fn get_object_class(&self) -> &ObjectClass
fn set_property<'a, N: Into<&'a str>>( &self, property_name: N, value: &dyn ToValue, ) -> Result<(), BoolError>
fn get_property<'a, N: Into<&'a str>>( &self, property_name: N, ) -> Result<Value, BoolError>
fn has_property<'a, N: Into<&'a str>>( &self, property_name: N, type_: Option<Type>, ) -> Result<(), BoolError>
fn get_property_type<'a, N: Into<&'a str>>( &self, property_name: N, ) -> Option<Type>
fn find_property<'a, N: Into<&'a str>>( &self, property_name: N, ) -> Option<ParamSpec>
fn list_properties(&self) -> Vec<ParamSpec>
fn block_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn stop_signal_emission(&self, signal_name: &str)
fn connect<'a, N, F>( &self, signal_name: N, after: bool, callback: F, ) -> Result<SignalHandlerId, BoolError>
unsafe fn connect_unsafe<'a, N, F>( &self, signal_name: N, after: bool, callback: F, ) -> Result<SignalHandlerId, BoolError>
fn emit<'a, N: Into<&'a str>>( &self, signal_name: N, args: &[&dyn ToValue], ) -> Result<Option<Value>, BoolError>
fn disconnect(&self, handler_id: SignalHandlerId)
fn connect_notify<F: Fn(&Self, &ParamSpec) + Send + Sync + 'static>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F: Fn(&Self, &ParamSpec)>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
fn notify<'a, N: Into<&'a str>>(&self, property_name: N)
fn notify_by_pspec(&self, pspec: &ParamSpec)
fn downgrade(&self) -> WeakRef<Self>
fn bind_property<'a, O: ObjectType, N: Into<&'a str>, M: Into<&'a str>>( &'a self, source_property: N, target: &'a O, target_property: M, ) -> BindingBuilder<'a>
fn ref_count(&self) -> u32
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.