dbus-tree 0.9.2

Framework for writing D-Bus method handlers (legacy)
Documentation
  • Coverage
  • 96.36%
    53 out of 55 items documented1 out of 1 items with examples
  • Size
  • Source code size: 99.06 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.84 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Documentation
  • diwic/dbus-rs
    660 141 12
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • diwic

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.