dbus2 / zbus-old

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

Automated way to ensure Send and/or Sync impls #150

Closed zeenix closed 1 year ago

zeenix commented 3 years ago

It's very easy to break API accidently by use of data structures that drop blanket implementations, especially Send and Sync. For named types (struct and enums) you can manually check by looking at the generated docs (not at all a reliable method as you can forget to do so) but for futures returned by async functions, there is no way that I know.

Hence, we should make use of static_assertions::assert_impl_all (or must-implement-trait if we want something small/specific) and async_auto_traits::assert API to ensure this in an automated way.

zeenix commented 3 years ago

Split the part about futures returned by async functions, into #165.

zeenix commented 3 years ago

mentioned in commit c605097f9e8727bca6cd89db3498dd367ce20f57