Jan
Jan

Reputation: 314

How to create a D-Bus server with zbus in Rust?

I'm currently trying to implement the example Server code from the zbus doc.

I copied the code and changed the path at serve_at():

let greeter = Greeter {count: 0};
     let _ = ConnectionBuilder::session()?
             .name("org.zbus.MyGreeter")?
             .serve_at("/Users/jan/Documents/MyGreeter", greeter)?
             .build()
             .await?;

After some debugging I figured out that the error comes from the named function:

Error: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })

I'm using a Mac with a M1 CPU, installed, and started the dbus service but that didn't helped. What do I do wrong here?

Upvotes: 0

Views: 469

Answers (1)

zeenix
zeenix

Reputation: 111

Sorry for the late response but I just accidentally stumbled on this.

The example code will only work out-of-the-box on non-Linux machines. It requires a session bus broker/daemon. You can install and run a dbus reference implementation or use peer-to-peer connection.

Upvotes: 1

Related Questions