Struct zbus::fdo::DBusProxy [−][src]
pub struct DBusProxy<'c>(_);
Expand description
Proxy for the org.freedesktop.DBus
interface.
Implementations
Creates a new proxy with the default service & path.
Returns a customizable builder for this proxy.
Consumes self
, returning the underlying zbus::Proxy
.
Adds a match rule to match messages going through the message bus
Returns auditing data used by Solaris ADT, in an unspecified binary format.
pub fn get_connection_credentials(
&self,
bus_name: &str
) -> Result<HashMap<String, OwnedValue>>
[src]
pub fn get_connection_credentials(
&self,
bus_name: &str
) -> Result<HashMap<String, OwnedValue>>
[src]Returns as many credentials as possible for the process connected to the server.
Returns the security context used by SELinux, in an unspecified format.
Returns the Unix process ID of the process connected to the server.
Returns the Unix user ID of the process connected to the server.
Returns the unique connection name of the primary owner of the name given.
Returns a list of all names that can be activated on the bus.
Returns a list of all currently-owned names on the bus.
List the connections currently queued for a bus name.
Checks if the specified name exists (currently has an owner).
Ask the message bus to release the method caller’s claim to the given name.
Reload server configuration.
Removes the first rule that matches.
pub fn request_name(
&self,
name: &str,
flags: BitFlags<RequestNameFlags>
) -> Result<RequestNameReply>
[src]
pub fn request_name(
&self,
name: &str,
flags: BitFlags<RequestNameFlags>
) -> Result<RequestNameReply>
[src]Ask the message bus to assign the given name to the method caller.
Tries to launch the executable associated with a name (service activation), as an explicit request.
This method adds to or modifies that environment when activating services.
Connect the handler for the NameOwnerChanged
signal. This is a convenient wrapper around zbus::Proxy::connect_signal
.
This signal indicates that the owner of a name has
changed. It’s also the signal to use to detect the appearance
of new names on the bus.
pub fn connect_name_lost<__H>(&self, handler: __H) -> Result<SignalHandlerId> where
__H: FnMut(&str) -> Result<()> + Send + 'static,
[src]
pub fn connect_name_lost<__H>(&self, handler: __H) -> Result<SignalHandlerId> where
__H: FnMut(&str) -> Result<()> + Send + 'static,
[src]Connect the handler for the NameLost
signal. This is a convenient wrapper around zbus::Proxy::connect_signal
.
This signal is sent to a specific application when it loses ownership of a name.
pub fn connect_name_acquired<__H>(
&self,
handler: __H
) -> Result<SignalHandlerId> where
__H: FnMut(&str) -> Result<()> + Send + 'static,
[src]
pub fn connect_name_acquired<__H>(
&self,
handler: __H
) -> Result<SignalHandlerId> where
__H: FnMut(&str) -> Result<()> + Send + 'static,
[src]Connect the handler for the NameAcquired
signal. This is a convenient wrapper around zbus::Proxy::connect_signal
.
This signal is sent to a specific application when it gains ownership of a name.
This property lists abstract “features” provided by the message bus, and can be used by clients to detect the capabilities of the message bus with which they are communicating.
This property lists interfaces provided by the /org/freedesktop/DBus
object, and can be
used by clients to detect the capabilities of the message bus with which they are
communicating. Unlike the standard Introspectable interface, querying this property does not
require parsing XML. This property was added in version 1.11.x of the reference
implementation of the message bus.
The standard org.freedesktop.DBus
and org.freedesktop.DBus.Properties
interfaces are not
included in the value of this property, because their presence can be inferred from the fact
that a method call on org.freedesktop.DBus.Properties
asking for properties of
org.freedesktop.DBus
was successful. The standard org.freedesktop.DBus.Peer
and
org.freedesktop.DBus.Introspectable
interfaces are not included in the value of this
property either, because they do not indicate features of the message bus implementation.
Methods from Deref<Target = Proxy<'c>>
Get a reference to the associated connection.
Get a reference to the destination service name.
Get a reference to the object path.
Introspect the associated object, and return the XML description.
See the xml module for parsing the result.
Get the property property_name
.
Effectively, call the Get
method of the org.freedesktop.DBus.Properties
interface.
Set the property property_name
.
Effectively, call the Set
method of the org.freedesktop.DBus.Properties
interface.
Call a method and return the reply.
Typically, you would want to use call
method instead. Use this method if you need to
deserialize the reply message manually (this way, you can avoid the memory
allocation/copying, by deserializing the reply to an unowned type).
Call a method and return the reply body.
Use call_method
instead if you need to deserialize the reply manually/separately.
pub fn connect_signal<H>(
&self,
signal_name: &'static str,
handler: H
) -> Result<SignalHandlerId> where
H: FnMut(&Message) -> Result<()> + Send + 'static,
[src]
pub fn connect_signal<H>(
&self,
signal_name: &'static str,
handler: H
) -> Result<SignalHandlerId> where
H: FnMut(&Message) -> Result<()> + Send + 'static,
[src]Register a handler for signal named signal_name
.
Once a handler is successfully registered, call Self::next_signal
to wait for the next
signal to arrive and be handled by its registered handler. A unique ID for the handler is
returned, which can be used to deregister this handler using Self::disconnect_signal
method.
Errors
This method can fail if addition of the relevant match rule on the bus fails. You can
safely unwrap
the Result
if you’re certain that associated connection is not a bus
connection.
Deregister the signal handler with the ID handler_id
.
This method returns Ok(true)
if a handler with the id handler_id
is found and removed;
Ok(false)
otherwise.
Errors
This method can fail if removal of the relevant match rule on the bus fails. You can
safely unwrap
the Result
if you’re certain that associated connection is not a bus
connection.
Receive and handle the next incoming signal on the associated connection.
This method will wait for signal messages on the associated connection and call any
handlers registered through the Self::connect_signal
method. Signal handlers can be
registered and deregistered from another threads during the call to this method.
If the signal message was handled by a handler, Ok(None)
is returned. Otherwise, the
received message is returned.
Errors
Apart from general I/O errors that can result from socket communications, calling this method will also result in an error if the destination service has not yet registered its well-known name with the bus (assuming you’re using the well-known name as destination).
Handle the provided signal message.
Call any handlers registered through the Self::connect_signal
method for the provided
signal message.
If no errors are encountered, Ok(true)
is returned if a handler was found and called for,
the signal; Ok(false)
otherwise.
Trait Implementations
Auto Trait Implementations
impl<'c> !RefUnwindSafe for DBusProxy<'c>
impl<'c> !UnwindSafe for DBusProxy<'c>