Partially implement thread scheduling attributes API proposal by ian-h-chamberlain · Pull Request #101222 · rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could only do so if imp::Priority was also re-exported (otherwise it's a private type in a public interface).

I couldn't find many (if any) instances of re-exporting things from sys, although in this case it would really be a re-export of stuff from os which is already public, so maybe it would be fine? Even so, I think it would mean that Priority + Affinity would have do be documented in every variation of sys::* rather than just once in the public interface.

Also, for those unsupported platforms that just use () my thinking was it would make more sense to use an "unconstructible" public type. I suppose re-exporting a struct Priority(()) would achieve the same.