rust-windowing / raw-window-handle

A common windowing interoperability library for Rust
Apache License 2.0
314 stars 49 forks source link

Does `RawWindowHandle` need to be `Copy`? #138

Closed grovesNL closed 1 year ago

grovesNL commented 1 year ago

It looks like the Copy derive was added in #18, I guess because each handle happened to be compatible with it at the time.

However there are some benefits to removing Copy, e.g. it makes it possible to include strongly typed web handles that are reference counted (not Copy) https://github.com/rust-windowing/raw-window-handle/pull/134#issuecomment-1666306670

Lokathor commented 1 year ago

My vote would be that it doesn't need to be Copy.

People should be paying close attention to code using these values and an occasional .clone() won't hurt them

notgull commented 1 year ago

I like the idea of a window/display handle having the same semantics as an &T reference. However I'd not married to this idea, so if the general consensus is to remove Copy I would be all for it.

kchibisov commented 1 year ago

Yeah, don't see nothing wrong with it.