#dbus #ipc #api-bindings

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

#888 in Unix APIs

Download history 28801/week @ 2025-06-03 30226/week @ 2025-06-10 29126/week @ 2025-06-17 30047/week @ 2025-06-24 29998/week @ 2025-07-01 28321/week @ 2025-07-08 30062/week @ 2025-07-15 27173/week @ 2025-07-22 29007/week @ 2025-07-29 30728/week @ 2025-08-05 32442/week @ 2025-08-12 30820/week @ 2025-08-19 31804/week @ 2025-08-26 30939/week @ 2025-09-02 39445/week @ 2025-09-09 36385/week @ 2025-09-16

143,376 downloads per month
Used in 59 crates (27 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

~3–11MB
~112K SLoC