Closed madsmtm closed 1 year ago
Related: What is the value even in having two traits? Is it just that way because we're yet unsure of the design?
I think it'd make sense to combine them into a single HasWindowHandle/HasDisplayHandle
trait.
This change would make the semver trick hard to do... but #136 would already make it impossible so why not just go full ham?
I've often compared the difference between HasRawWindowHandle
and HasWindowHandle
to the difference between AsRawFd
and AsFd
in the standard library. However, I struggle to think of a use case where a type would implement HasRawWindowHandle
and not HasWindowHandle
. The standard library has to keep AsRawFd
forever to avoid a breaking change, but we don't.
I would be in favor of just merging the traits.
I think the semver trick is basically already impossible, see https://github.com/rust-windowing/raw-window-handle/issues/125#issuecomment-1605655931.
Should there be a type-system relationship between these?
I think it would make sense to make the normal handles subtraits of the raw handles, i.e.
trait HasWindowHandle: HasRawWindowHandle { ... }
?Or maybe we should do a blanket
impl<T: HasWindowHandle> for HasRawWindowHandle {}
, or vice-versa?