pub trait DBusInterfaceSkeletonExt:
IsA<DBusInterfaceSkeleton>
+ Sealed
+ 'static {
Show 16 methods
// Provided methods
fn export(
&self,
connection: &DBusConnection,
object_path: &str,
) -> Result<(), Error> { ... }
fn flush(&self) { ... }
fn connection(&self) -> Option<DBusConnection> { ... }
fn connections(&self) -> Vec<DBusConnection> { ... }
fn flags(&self) -> DBusInterfaceSkeletonFlags { ... }
fn info(&self) -> DBusInterfaceInfo { ... }
fn object_path(&self) -> Option<GString> { ... }
fn properties(&self) -> Variant { ... }
fn has_connection(&self, connection: &DBusConnection) -> bool { ... }
fn set_flags(&self, flags: DBusInterfaceSkeletonFlags) { ... }
fn unexport(&self) { ... }
fn unexport_from_connection(&self, connection: &DBusConnection) { ... }
fn g_flags(&self) -> DBusInterfaceSkeletonFlags { ... }
fn set_g_flags(&self, g_flags: DBusInterfaceSkeletonFlags) { ... }
fn connect_g_authorize_method<F: Fn(&Self, &DBusMethodInvocation) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_g_flags_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
Sourcefn export(
&self,
connection: &DBusConnection,
object_path: &str,
) -> Result<(), Error>
fn export( &self, connection: &DBusConnection, object_path: &str, ) -> Result<(), Error>
Exports @self at @object_path on @connection.
This can be called multiple times to export the same @self onto multiple connections however the @object_path provided must be the same for all connections.
Use g_dbus_interface_skeleton_unexport() to unexport the object.
§connection
A #GDBusConnection to export @self on.
§object_path
The path to export the interface at.
§Returns
true
if the interface was exported on @connection, otherwise false
with
@error set.
Sourcefn flush(&self)
fn flush(&self)
If @self has outstanding changes, request for these changes to be emitted immediately.
For example, an exported D-Bus interface may queue up property
changes and emit the
org.freedesktop.DBus.Properties.PropertiesChanged
signal later (e.g. in an idle handler). This technique is useful
for collapsing multiple property changes into one.
Sourcefn connection(&self) -> Option<DBusConnection>
fn connection(&self) -> Option<DBusConnection>
Sourcefn connections(&self) -> Vec<DBusConnection>
fn connections(&self) -> Vec<DBusConnection>
Gets a list of the connections that @self is exported on.
§Returns
A list of all the connections that @self is exported on. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref().
Sourcefn flags(&self) -> DBusInterfaceSkeletonFlags
fn flags(&self) -> DBusInterfaceSkeletonFlags
Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior of @self
§Returns
One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
Sourcefn info(&self) -> DBusInterfaceInfo
fn info(&self) -> DBusInterfaceInfo
Sourcefn object_path(&self) -> Option<GString>
fn object_path(&self) -> Option<GString>
Sourcefn properties(&self) -> Variant
fn properties(&self) -> Variant
Gets all D-Bus properties for @self.
§Returns
A #GVariant of type [‘a{sv}’][G-VARIANT-TYPE-VARDICT:CAPS]. Free with g_variant_unref().
Sourcefn has_connection(&self, connection: &DBusConnection) -> bool
fn has_connection(&self, connection: &DBusConnection) -> bool
Sourcefn set_flags(&self, flags: DBusInterfaceSkeletonFlags)
fn set_flags(&self, flags: DBusInterfaceSkeletonFlags)
Sets flags describing what the behavior of @skeleton should be.
§flags
Flags from the #GDBusInterfaceSkeletonFlags enumeration.
Sourcefn unexport(&self)
fn unexport(&self)
Stops exporting @self on all connections it is exported on.
To unexport @self from only a single connection, use g_dbus_interface_skeleton_unexport_from_connection()
Sourcefn unexport_from_connection(&self, connection: &DBusConnection)
fn unexport_from_connection(&self, connection: &DBusConnection)
Stops exporting @self on @connection.
To stop exporting on all connections the interface is exported on, use g_dbus_interface_skeleton_unexport().
§connection
A #GDBusConnection.
Sourcefn g_flags(&self) -> DBusInterfaceSkeletonFlags
fn g_flags(&self) -> DBusInterfaceSkeletonFlags
Flags from the #GDBusInterfaceSkeletonFlags enumeration.
Sourcefn set_g_flags(&self, g_flags: DBusInterfaceSkeletonFlags)
fn set_g_flags(&self, g_flags: DBusInterfaceSkeletonFlags)
Flags from the #GDBusInterfaceSkeletonFlags enumeration.
Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.
Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. polkit_authority_check_authorization_sync() with the POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION flag set.
If false
is returned then no further handlers are run and the
signal handler must take a reference to @invocation and finish
handling the call (e.g. return an error via
g_dbus_method_invocation_return_error()).
Otherwise, if true
is returned, signal emission continues. If no
handlers return false
, then the method is dispatched. If
@interface has an enclosing #GDBusObjectSkeleton, then the
#GDBusObjectSkeleton::authorize-method signal handlers run before
the handlers for this signal.
The default class handler just returns true
.
Please note that the common case is optimized: if no signals
handlers are connected and the default class handler isn’t
overridden (for both @interface and the enclosing
#GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
not have the
DBusInterfaceSkeletonFlags::HANDLE_METHOD_INVOCATIONS_IN_THREAD
flags set, no dedicated thread is ever used and the call will be
handled in the same thread as the object that @interface belongs
to was exported in.
§invocation
A #GDBusMethodInvocation.
§Returns
fn connect_g_flags_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
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.