Crate dbus_tree[][src]

Expand description

Contains functionality for dispatching methods on a D-Bus “server”.

Example

use dbus_tree::Factory;
use dbus::ffidisp::Connection;
let f = Factory::new_fn::<()>();
/* Add a method returning "Thanks!" on interface "com.example.dbus.rs"
   on object path "/example". */
let t = f.tree(()).add(f.object_path("/example", ()).introspectable()
    .add(f.interface("com.example.dbus.rs", ())
        .add_m(f.method("CallMe", (), |m| {
            Ok(vec!(m.msg.method_return().append1("Thanks!"))) }
        ).out_arg("s"))
));

let c = Connection::new_session().unwrap();
t.set_registered(&c, true).unwrap();
c.add_handler(t);
/* Run forever */
loop { c.incoming(1000).next(); }

See examples/server.rs and examples/adv_server.rs for more thorough examples.

Structs

A D-Bus Argument.

The factory is used to create object paths, interfaces, methods etc.

Represents a D-Bus interface.

Iterator struct, returned from iterator methods on Tree, Objectpath and Interface.

An abstract type to represent Fn functions.

An abstract type to represent FnMut functions.

An abstract type to represent Fn + Send + Sync functions (that can be called from several threads in parallel).

A D-Bus Method.

A D-Bus Method Error, containing an error name and a description.

Contains information about the incoming method call.

A D-Bus Object Path.

Contains information about the incoming property get/set request.

A D-Bus Property.

A D-Bus Signal.

A collection of object paths.

An iterator adapter that handles incoming method calls.

Enums

The possible access characteristics a Property can have.

Enumerates the different signaling behaviors a Property can have to being changed.

Traits

Associated data for different objects in a tree.

A helper trait used internally to make the tree generic over MTFn, MTFnMut and MTSync.

Type Definitions

Result containing the Messages returned from the Method, or a MethodErr.