Trait glib::object::ObjectExt[][src]

pub trait ObjectExt: ObjectType {
Show methods fn is<T: StaticType>(&self) -> bool;
fn type_(&self) -> Type;
fn object_class(&self) -> &ObjectClass;
fn class(&self) -> &Class<Self>
    where
        Self: IsClass
;
fn class_of<T: IsClass>(&self) -> Option<&Class<T>>;
fn interface<T: IsInterface>(&self) -> Option<InterfaceRef<'_, T>>;
fn set_property<'a, N: Into<&'a str>, V: ToValue>(
        &self,
        property_name: N,
        value: V
    ) -> Result<(), BoolError>;
fn set_property_from_value<'a, N: Into<&'a str>>(
        &self,
        property_name: N,
        value: &Value
    ) -> Result<(), BoolError>;
fn set_properties(
        &self,
        property_values: &[(&str, &dyn ToValue)]
    ) -> Result<(), BoolError>;
fn set_properties_from_value(
        &self,
        property_values: &[(&str, Value)]
    ) -> Result<(), BoolError>;
fn 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>
    ) -> bool;
fn 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 freeze_notify(&self) -> PropertyNotificationFreezeGuard;
unsafe fn set_qdata<QD: 'static>(&self, key: Quark, value: QD);
unsafe fn qdata<QD: 'static>(&self, key: Quark) -> Option<NonNull<QD>>;
unsafe fn steal_qdata<QD: 'static>(&self, key: Quark) -> Option<QD>;
unsafe fn set_data<QD: 'static>(&self, key: &str, value: QD);
unsafe fn data<QD: 'static>(&self, key: &str) -> Option<NonNull<QD>>;
unsafe fn steal_data<QD: 'static>(&self, key: &str) -> Option<QD>;
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
;
fn connect_id<F>(
        &self,
        signal_id: SignalId,
        details: Option<Quark>,
        after: bool,
        callback: F
    ) -> Result<SignalHandlerId, BoolError>
    where
        F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static
;
fn connect_local<'a, N, F>(
        &self,
        signal_name: N,
        after: bool,
        callback: F
    ) -> Result<SignalHandlerId, BoolError>
    where
        N: Into<&'a str>,
        F: Fn(&[Value]) -> Option<Value> + 'static
;
fn connect_local_id<F>(
        &self,
        signal_id: SignalId,
        details: Option<Quark>,
        after: bool,
        callback: F
    ) -> Result<SignalHandlerId, BoolError>
    where
        F: Fn(&[Value]) -> Option<Value> + '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>
;
unsafe fn connect_unsafe_id<F>(
        &self,
        signal_id: SignalId,
        details: Option<Quark>,
        after: bool,
        callback: F
    ) -> Result<SignalHandlerId, BoolError>
    where
        F: Fn(&[Value]) -> Option<Value>
;
fn emit(
        &self,
        signal_id: SignalId,
        args: &[&dyn ToValue]
    ) -> Result<Option<Value>, BoolError>;
fn emit_with_values(
        &self,
        signal_id: SignalId,
        args: &[Value]
    ) -> Result<Option<Value>, BoolError>;
fn emit_by_name<'a, N: Into<&'a str>>(
        &self,
        signal_name: N,
        args: &[&dyn ToValue]
    ) -> Result<Option<Value>, BoolError>;
fn emit_by_name_with_values<'a, N: Into<&'a str>>(
        &self,
        signal_name: N,
        args: &[Value]
    ) -> Result<Option<Value>, BoolError>;
fn emit_with_details(
        &self,
        signal_id: SignalId,
        details: Quark,
        args: &[&dyn ToValue]
    ) -> Result<Option<Value>, BoolError>;
fn emit_with_details_and_values(
        &self,
        signal_id: SignalId,
        details: Quark,
        args: &[Value]
    ) -> 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;
fn connect_notify_local<F: Fn(&Self, &ParamSpec) + '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

Returns true if the object is an instance of (can be cast to) T.

Safety

This function doesn’t store type information

Safety

The returned pointer can become invalid by a call to set_qdata, steal_qdata, set_data or steal_data.

The caller is responsible for ensuring the returned value is of a suitable type

Safety

The caller is responsible for ensuring the returned value is of a suitable type

Safety

This function doesn’t store type information

Safety

The returned pointer can become invalid by a call to set_qdata, steal_qdata, set_data or steal_data.

The caller is responsible for ensuring the returned value is of a suitable type

Safety

The caller is responsible for ensuring the returned value is of a suitable type

Same as connect but takes a SignalId instead of a signal name.

Same as connect_local but takes a SignalId instead of a signal name.

Same as connect_unsafe but takes a SignalId instead of a signal name.

Emit signal by signal id.

Same as emit but takes Value for the arguments.

Emit signal by it’s name.

Same as emit_by_name but takes Value for the arguments.

Emit signal with details by signal id.

Same as emit_with_details but takes Value for the arguments.

Implementors