pub struct Task<V: ValueType + Send> { /* private fields */ }Expand description
Task provides idiomatic access to gio’s GTask API, for
instance by being generic over their value type, while not completely departing
from the underlying C API. Task is Send and Sync and requires its value to
also be Send and Sync, thus is useful to to implement gio style asynchronous
tasks that run in threads. If you need to only run tasks in glib main loop
see the LocalTask type.
The constructors of LocalTask and Task is marked as unsafe because this API does
not allow to automatically enforce all the invariants required to be a completely
safe abstraction. The caller is responsible to ensure the following requirements
are satisfied
-
You should not create a
LocalTask, upcast it to aglib::Objectand then downcast it to aTask, as this will bypass the thread safety requirements -
You should ensure that the
return_result,return_error_if_cancelledandpropagate()methods are only called once. error); if (error) { g_task_return_error (task, error); return; }// If the task has already been cancelled, then we don’t want to add // the cake to the cake cache. Likewise, we don’t want to have the // task get cancelled in the middle of updating the cache. // g_task_set_return_on_cancel() will return
truehere if it managed // to disable return-on-cancel, orfalseif the task was cancelled // before it could. if (g_task_set_return_on_cancel (task, FALSE)) { // If the caller cancels at this point, their // GAsyncReadyCallback won’t be invoked until we return, // so we don’t have to worry that this code will run at // the same time as that code does. But if there were // other functions that might look at the cake cache, // then we’d probably need a GMutex here as well. baker_add_cake_to_cache (baker, cake); g_task_return_pointer (task, cake, g_object_unref); } }
void baker_bake_cake_async (Baker *self, guint radius, CakeFlavor flavor, CakeFrostingType frosting, const char *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { CakeData *cake_data; GTask *task;
cake_data = g_slice_new (CakeData);
…
task = g_task_new (self, cancellable, callback, user_data); g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free); g_task_set_return_on_cancel (task, TRUE); g_task_run_in_thread (task, bake_cake_thread); }
Cake * baker_bake_cake_sync (Baker *self, guint radius, CakeFlavor flavor, CakeFrostingType frosting, const char *message, GCancellable *cancellable, GError **error) { CakeData *cake_data; GTask *task; Cake *cake;
cake_data = g_slice_new (CakeData);
…
task = g_task_new (self, cancellable, NULL, NULL); g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free); g_task_set_return_on_cancel (task, TRUE); g_task_run_in_thread_sync (task, bake_cake_thread);
cake = g_task_propagate_pointer (task, error); g_object_unref (task); return cake; }
## Porting from `Gio::SimpleAsyncResult`
`GTask`’s API attempts to be simpler than `Gio::SimpleAsyncResult`’s
in several ways:
- You can save task-specific data with [`set_task_data()`][Self::set_task_data()], and
retrieve it later with [`task_data()`][Self::task_data()]. This replaces the
abuse of `Gio::SimpleAsyncResult::set_op_res_gpointer()` for the same
purpose with `Gio::SimpleAsyncResult`.
- In addition to the task data, `GTask` also keeps track of the
[priority](iface.AsyncResult.html#io-priority), [`Cancellable`][crate::Cancellable],
and [`glib::MainContext`][crate::glib::MainContext] associated with the task, so tasks that
consist of a chain of simpler asynchronous operations will have easy access
to those values when starting each sub-task.
- [`return_error_if_cancelled()`][Self::return_error_if_cancelled()] provides simplified
handling for cancellation. In addition, cancellation
overrides any other `GTask` return value by default, like
`Gio::SimpleAsyncResult` does when
`Gio::SimpleAsyncResult::set_check_cancellable()` is called.
(You can use [`set_check_cancellable()`][Self::set_check_cancellable()] to turn off that
behavior.) On the other hand, [`run_in_thread()`][Self::run_in_thread()]
guarantees that it will always run your
`task_func`, even if the task’s [`Cancellable`][crate::Cancellable]
is already cancelled before the task gets a chance to run;
you can start your `task_func` with a
[`return_error_if_cancelled()`][Self::return_error_if_cancelled()] check if you need the
old behavior.
- The ‘return’ methods (eg, [`return_pointer()`][Self::return_pointer()])
automatically cause the task to be ‘completed’ as well, and
there is no need to worry about the ‘complete’ vs ‘complete in idle’
distinction. (`GTask` automatically figures out
whether the task’s callback can be invoked directly, or
if it needs to be sent to another [`glib::MainContext`][crate::glib::MainContext], or delayed
until the next iteration of the current [`glib::MainContext`][crate::glib::MainContext].)
- The ‘finish’ functions for `GTask` based operations are generally
much simpler than `Gio::SimpleAsyncResult` ones, normally consisting
of only a single call to [`propagate_pointer()`][Self::propagate_pointer()] or the like.
Since [`propagate_pointer()`][Self::propagate_pointer()] ‘steals’ the return value from
the `GTask`, it is not necessary to juggle pointers around to
prevent it from being freed twice.
- With `Gio::SimpleAsyncResult`, it was common to call
`Gio::SimpleAsyncResult::propagate_error()` from the
`_finish()` wrapper function, and have
virtual method implementations only deal with successful
returns. This behavior is deprecated, because it makes it
difficult for a subclass to chain to a parent class’s async
methods. Instead, the wrapper function should just be a
simple wrapper, and the virtual method should call an
appropriate `g_task_propagate_` function.
Note that wrapper methods can now use
[`AsyncResultExt::legacy_propagate_error()`][crate::prelude::AsyncResultExt::legacy_propagate_error()] to do old-style
`Gio::SimpleAsyncResult` error-returning behavior, and
`Gio::AsyncResult::is_tagged()` to check if a result is tagged as
having come from the `_async()` wrapper
function (for ‘short-circuit’ results, such as when passing
`0` to [`InputStreamExtManual::read_async()`][crate::prelude::InputStreamExtManual::read_async()]).
## Thread-safety considerations
Due to some infelicities in the API design, there is a
thread-safety concern that users of `GTask` have to be aware of:
If the `main` thread drops its last reference to the source object
or the task data before the task is finalized, then the finalizers
of these objects may be called on the worker thread.
This is a problem if the finalizers use non-threadsafe API, and
can lead to hard-to-debug crashes. Possible workarounds include:
- Clear task data in a signal handler for `notify::completed`
- Keep iterating a main context in the main thread and defer
dropping the reference to the source object to that main
context when the task is finalized
## Properties
#### `completed`
Whether the task has completed, meaning its callback (if set) has been
invoked.
This can only happen after g_task_return_pointer(),
g_task_return_error() or one of the other return functions have been called
on the task. However, it is not guaranteed to happen immediately after
those functions are called, as the task’s callback may need to be scheduled
to run in a different thread.
That means it is **not safe** to use this property to track whether a
return function has been called on the #GTask. Callers must do that
tracking themselves, typically by linking the lifetime of the #GTask to the
control flow of their code.
This property is guaranteed to change from [`false`] to [`true`] exactly once.
The #GObject::notify signal for this change is emitted in the same main
context as the task’s callback, immediately after that callback is invoked.
Readable
# Implements
[`trait@glib::ObjectExt`], [`AsyncResultExt`][trait@crate::prelude::AsyncResultExt]
GLib type: GObject with reference counted clone semantics.Implementations§
Source§impl<V: Into<Value> + ValueType + Send> Task<V>
impl<V: Into<Value> + ValueType + Send> Task<V>
pub unsafe fn new<S, P, Q>( source_object: Option<&S>, cancellable: Option<&P>, callback: Q, ) -> Self
pub fn cancellable(&self) -> Option<Cancellable>
pub fn is_check_cancellable(&self) -> bool
pub fn set_check_cancellable(&self, check_cancellable: bool)
pub fn set_name(&self, name: Option<&str>)
v2_60 only.pub fn set_return_on_cancel(&self, return_on_cancel: bool) -> bool
pub fn is_valid( result: &impl IsA<AsyncResult>, source_object: Option<&impl IsA<Object>>, ) -> bool
pub fn priority(&self) -> Priority
pub fn set_priority(&self, priority: Priority)
pub fn is_completed(&self) -> bool
pub fn context(&self) -> MainContext
pub fn name(&self) -> Option<GString>
v2_60 only.pub fn is_return_on_cancel(&self) -> bool
pub fn had_error(&self) -> bool
pub fn connect_completed_notify<F>(&self, f: F) -> SignalHandlerId
pub unsafe fn return_error_if_cancelled(&self) -> bool
Sourcepub unsafe fn return_result(self, result: Result<V, Error>)
pub unsafe fn return_result(self, result: Result<V, Error>)
Set the result of the task
§Safety
The value must be read with Task::propagate,
g_task_propagate_value or g_task_propagate_pointer.
Sourcepub unsafe fn return_boolean_result(self, result: Result<bool, Error>)
pub unsafe fn return_boolean_result(self, result: Result<bool, Error>)
Set the result of the task as a boolean
§Safety
The value must be read with Task::propagate_boolean,
or g_task_propagate_boolean.
Sourcepub unsafe fn return_int_result(self, result: Result<isize, Error>)
pub unsafe fn return_int_result(self, result: Result<isize, Error>)
Set the result of the task as an int
§Safety
The value must be read with Task::propagate_int,
or g_task_propagate_int.
Sourcepub unsafe fn propagate(self) -> Result<V, Error>
pub unsafe fn propagate(self) -> Result<V, Error>
Gets the result of the task and transfers ownership of it
§Safety
This must only be called once, and only if the result was set
via Task::return_result, g_task_return_value or
g_task_return_pointer.
Sourcepub unsafe fn propagate_boolean(self) -> Result<bool, Error>
pub unsafe fn propagate_boolean(self) -> Result<bool, Error>
Gets the result of the task as a boolean, or the error
§Safety
This must only be called once, and only if the result was set
via Task::return_boolean_result, or g_task_return_boolean.
Sourcepub unsafe fn propagate_int(self) -> Result<isize, Error>
pub unsafe fn propagate_int(self) -> Result<isize, Error>
Gets the result of the task as an int, or the error
§Safety
This must only be called once, and only if the result was set
via Task::return_int_result, or g_task_return_int.
Trait Implementations§
impl<V: ValueType + Send> Eq for Task<V>
impl<V: ValueType + Send> IsA<AsyncResult> for Task<V>
Source§impl<V: ValueType + Send> Ord for Task<V>
impl<V: ValueType + Send> Ord for Task<V>
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Comparison for two GObjects.
Compares the memory addresses of the provided objects.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<OT: ObjectType, V: ValueType + Send> PartialOrd<OT> for Task<V>
impl<OT: ObjectType, V: ValueType + Send> PartialOrd<OT> for Task<V>
Source§fn partial_cmp(&self, other: &OT) -> Option<Ordering>
fn partial_cmp(&self, other: &OT) -> Option<Ordering>
Partial comparison for two GObjects.
Compares the memory addresses of the provided objects.
impl<V: ValueType + Send> Send for Task<V>
Source§impl<V: ValueType + Send> StaticType for Task<V>
impl<V: ValueType + Send> StaticType for Task<V>
Source§fn static_type() -> Type
fn static_type() -> Type
Self.impl<V: ValueType + Send> Sync for Task<V>
Auto Trait Implementations§
impl<V> Freeze for Task<V>
impl<V> RefUnwindSafe for Task<V>where
V: RefUnwindSafe,
impl<V> Unpin for Task<V>where
V: Unpin,
impl<V> UnsafeUnpin for Task<V>
impl<V> UnwindSafe for Task<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<O> AsyncResultExt for Owhere
O: IsA<AsyncResult>,
impl<O> AsyncResultExt for Owhere
O: IsA<AsyncResult>,
Source§fn source_object(&self) -> Option<Object>
fn source_object(&self) -> Option<Object>
AsyncResult. Read moreSource§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
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast will do many checks at compile-time already. downcast will
perform the same checks at runtime as dynamic_cast, but will also ensure some amount of
compile-time safety. Read moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast and upcast will do many checks at compile-time already. Read moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<'a, T, C, E> FromValueOptional<'a> for Twhere
T: FromValue<'a, Checker = C>,
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>,
E: Error + Send + 'static,
Source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
Source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)
impl<Super, Sub> MayDowncastTo<Sub> for Super
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true if the object is an instance of (can be cast to) T.Source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass of the object. Read moreSource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
T. Read moreSource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
T of the object. Read moreSource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
Source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
Source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
property_name of the object and cast it to the type V. Read moreSource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name of the object. Read moreSource§fn has_property(&self, property_name: &str) -> bool
fn has_property(&self, property_name: &str) -> bool
property_name.Source§fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool
property_name of the given type_.Source§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name of this object. Read moreSource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec of the property property_name of this object.Source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec of the properties of this object.Source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
key. Read moreSource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
key. Read moreSource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values, or
invoke when using Rust closures.Source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit but takes Value for the arguments.Source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>
Source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
notify signal of the object. Read moreSource§fn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
Source§fn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
Source§fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
Source§fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + 'static,
fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + 'static,
Source§fn bind_property<'a, 'f, 't, O>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str,
) -> BindingBuilder<'a, 'f, 't>where
O: ObjectType,
fn bind_property<'a, 'f, 't, O>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str,
) -> BindingBuilder<'a, 'f, 't>where
O: ObjectType,
Source§unsafe fn run_dispose(&self)
unsafe fn run_dispose(&self)
Source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
Source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
Source§fn ensure_type()
fn ensure_type()
Source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue clone of self.