pub struct SyncConnection { /* private fields */ }
Expand description

A connection to D-Bus, Send + Sync + non-async version

Implementations

Create a new connection to the session bus.

Create a new connection to the system-wide bus.

Get the connection’s unique name.

It’s usually something like “:1.54”

Create a convenience struct for easier calling of many methods on the same destination and path.

Request a name on the D-Bus.

For detailed information on the flags and return values, see the libdbus documentation.

Release a previously requested name on the D-Bus.

Adds a new match to the connection, and sets up a callback when this message arrives.

If multiple MatchRules match the same message, then by default only the first match will get the callback. This behaviour can be changed for signal messages by calling set_signal_match_mode.

The returned value can be used to remove the match. The match is also removed if the callback returns “false”.

Adds a new match to the connection, without setting up a callback when this message arrives.

Removes a match from the connection, without removing any callbacks.

Removes a previously added match and callback from the connection.

If true, configures the connection to send signal messages to all matching MatchRule filters added with add_match rather than just the first one. This comes with the following gotchas:

  • The messages might be duplicated, so the message serial might be lost (this is generally not a problem for signals).
  • Panicking inside a match callback might mess with other callbacks, causing them to be permanently dropped.
  • Removing other matches from inside a match callback is not supported.

This is false by default, for a newly-created connection.

Tries to handle an incoming message if there is one. If there isn’t one, it will wait up to timeout

This method only takes “&self” instead of “&mut self”, but it is a logic error to call it recursively and might lead to panics or deadlocks.

For SyncConnection: It is also a logic error to call this method from one thread, while calling this or other methods from other threads. This can lead to messages being lost.

The channel for this connection

Trait Implementations

Sends a message over the D-Bus and blocks, waiting for a reply or a timeout. This is used for method calls. Read more

Converts to this type from the input type.

Internal helper trait

Type of callback

Add a callback to be called in case a message matches. Read more

Remove a previously added callback.

Schedules a message for sending. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.