dbus2 / zbus-old

Rust D-Bus crate.
https://gitlab.freedesktop.org/dbus/zbus
Other
49 stars 13 forks source link

Support for awaitable connection #317

Open zeenix opened 1 year ago

zeenix commented 1 year ago

In GitLab by @peelz on Jan 30, 2023, 19:40

It would be nice if connection errors could be reported to the caller by awaiting on the connection, e.g:

let connection = Connection::session().await?;

if let Err(err) = connection.await {
  error!("Something bad happened: {err}");
}
zeenix commented 1 year ago

I wonder if there is anything other than an error this Future impl can return. If it can only resolve to an error, that's what the output should be and not a Result.

zeenix commented 1 year ago

In GitLab by @peelz on Jan 31, 2023, 02:11

It should probably return a Result<(), ...> in case the connection were to close gracefully (see #309).

zeenix commented 1 year ago

hmm.. yeah if we go for #309, then definitely.