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

Crossroads is the “main” object, containing object paths, a registry of interfaces, and a crossreference of which object paths implement which interfaces.

You can store some arbitrary data with every object path if you like. This data can then be accessed from within the method callbacks. If you do not want this, just pass () as your data.

Crossroads can contain callbacks and data which is Send, but Sync is not required. Hence Crossroads itself is Send but not Sync.

Implementations§

Create a new Crossroads instance.

If set to true (the default), will make paths implement the standard “Introspectable” and, if the path has interfaces with properties, the “Properties” interfaces.

Registers a new interface into the interface registry. The closure receives an IfaceBuilder that you can add methods, signals and properties to.

Access the data of a certain path.

Will return none both if the path was not found, and if the found data was of another type.

Inserts a new path.

If the path already exists, it is overwritten.

Adds an interface to an existing object path.

Returns true if interface can be added to the object or already exists in the object. Returns false if the object does not exist or the interface cannot be added due to data type mismatch.

Removes an interface from an object path.

Returns true if the path exists and implements the interface

Removes an existing path.

Returns None if the path was not found. In case of a type mismatch, the path will be removed, but None will be returned.

Handles an incoming message call.

Returns Err if the message is not a method call.

The token representing the built-in implementation of “org.freedesktop.DBus.Introspectable”.

The token representing the built-in implementation of “org.freedesktop.DBus.Properties”.

The token representing the built-in implementation of “org.freedesktop.DBus.ObjectManager”.

You can add this to a path without enabling “set_object_manager_support”, but no signals will be sent.

Enables this crossroads instance to run asynchronous methods (and setting properties).

Incoming method calls are spawned as separate tasks if necessary. This provides the necessary abstractions needed to spawn a new tasks, and to send the reply when the task has finished.

Enables this crossroads instance to send signals when paths are added and removed.

The added/removed path is a subpath of a path which implements an object manager instance.

Serve clients forever on a blocking Connection.

This is a quick one-liner for the simplest case. In more advanced scenarios, you probably have to write similar code yourself.

Trait Implementations§

Formats the value using the given formatter. 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.