#d-bus #d-bus #ipc

dbus-crossroads

Framework for writing D-Bus method handlers

9 unstable releases

0.5.2 Jan 6, 2023
0.5.1 Jul 10, 2022
0.5.0 Sep 19, 2021
0.4.0 Jun 14, 2021
0.1.0 Jun 19, 2020

#398 in Unix APIs

Download history 14234/week @ 2023-10-28 13984/week @ 2023-11-04 16461/week @ 2023-11-11 14668/week @ 2023-11-18 15181/week @ 2023-11-25 17089/week @ 2023-12-02 16207/week @ 2023-12-09 15514/week @ 2023-12-16 13587/week @ 2023-12-23 14313/week @ 2023-12-30 15647/week @ 2024-01-06 15525/week @ 2024-01-13 16233/week @ 2024-01-20 16791/week @ 2024-01-27 18687/week @ 2024-02-03 16389/week @ 2024-02-10

70,526 downloads per month
Used in 33 crates (22 directly)

Apache-2.0/MIT

575KB
11K SLoC

crates.io API documentation license

dbus-crossroads is a library that helps you implement interfaces on object paths, i e "server side" method handler code.

It is not as mature as dbus::tree yet, but the API should be fairly stable and easier to use than dbus::tree. Go ahead and use it, and report any issues you find!

To get started, you can jump into the commented examples, one for sync one for async (dbus-tokio), and one slightly more advanced, or familiarize yourself using the API reference.

Design decisions (compared to dbus::tree):

  • First class support for both sync and async methods
  • Detect method arguments automatically through generics
  • ...but less generics in structs you use, which means less cluttered API
  • The tree/crossroads instance is Send (but not Sync).
  • You can now modify the instance from within a method handler
  • It is objects (paths) that can contain custom data, and they can contain different data for different objects
  • Interface descriptions are kept in a registry, which means less reference counting

Dependencies

~4.5MB
~106K SLoC