gio::prelude

Trait DebugControllerDBusExt

Source
pub trait DebugControllerDBusExt: IsA<DebugControllerDBus> + 'static {
    // Provided methods
    fn stop(&self) { ... }
    fn connect_authorize<F: Fn(&Self, &DBusMethodInvocation) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Available on crate feature v2_72 only.
Expand description

Trait containing all DebugControllerDBus methods.

§Implementors

DebugControllerDBus

Provided Methods§

Source

fn stop(&self)

Stop the debug controller, unregistering its object from the bus.

Any pending method calls to the object will complete successfully, but new ones will return an error. This method will block until all pending #GDebugControllerDBus::authorize signals have been handled. This is expected to not take long, as it will just be waiting for threads to join. If any #GDebugControllerDBus::authorize signal handlers are still executing in other threads, this will block until after they have returned.

This method will be called automatically when the final reference to the #GDebugControllerDBus is dropped. You may want to call it explicitly to know when the controller has been fully removed from the bus, or to break reference count cycles.

Calling this method from within a #GDebugControllerDBus::authorize signal handler will cause a deadlock and must not be done.

Source

fn connect_authorize<F: Fn(&Self, &DBusMethodInvocation) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a D-Bus peer is trying to change the debug settings and used to determine if that is authorized.

This signal is emitted in a dedicated worker thread, so handlers are allowed to perform blocking I/O. This means that, for example, it is appropriate to call polkit_authority_check_authorization_sync() to check authorization using polkit.

If false is returned then no further handlers are run and the request to change the debug settings is rejected.

Otherwise, if true is returned, signal emission continues. If no handlers return false, then the debug settings are allowed to be changed.

Signal handlers must not modify @invocation, or cause it to return a value.

The default class handler just returns true.

§invocation

A #GDBusMethodInvocation.

§Returns

true if the call is authorized, false otherwise.

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.

Implementors§