dbus2 / zbus-old

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

MessageBuilder related work #206

Open zeenix opened 3 years ago

zeenix commented 3 years ago

In GitLab by @danieldg on Aug 29, 2021, 03:25

Ideas for future work:

See !364

zeenix commented 2 years ago

In GitLab by @danieldg on Sep 29, 2021, 02:39

The second part was mostly done by !391 - though we could perhaps improve that by making those method not return Result as they are not supposed to fail give a valid Message (and all Message objects should be valid).

zeenix commented 2 years ago

This would allow making MessageFields private and have all access to headers be via method on Message that return Options instead of Result<Option<HeaderValue>>

Not sure this is a good idea. How would header attribute of dbus_interface methods work then? You'd need individual attributes for each field passed separately then. OTOH if we keep MessageFields around, I'm wondering why the message header/fields API can't be modified to always keep the headers in the decoded form (rather than Message doing that)?

zeenix commented 2 years ago

In GitLab by @danieldg on Sep 29, 2021, 17:52

You could swap that out for a message attribute instead. Or make a wrapper around Message (distinct from MessageFields) that only allows access to the header, but I don't see a need for that.

zeenix commented 2 years ago

I think I'm going to postpone this for zbus 3.0 because:

  1. Most important bits of this are already in place, I believe.
  2. It's mostly about convenience of the low-level API and I think that's already pretty convenient so don't think this is very high priority.
  3. Attaching the message to a connection, needs further thinking since so far, message and connection have been very detached from each other.
  4. @danieldg neither you, nor I have lately been able to get much time for zbus dev and 2.0 has been pending for more than 6 months at least.