Closed tgross35 closed 4 weeks ago
Converting a os::Library
into plain Library
with an .into()
seems pretty straightforward to me, so the safer API is within arm's reach at all times.
The fact that LoadFlags
is a OS dependent typedef seems iffy -- code written in a portable seeming way isn't actually portable. More generally I consider that to be a major footgun with exposing any sort of exposition of OS-specific details outside the os::*
modules and unless there is a very very good reason I would rather not break the os::*
encapsulation. At least not until https://github.com/rust-lang/rust/issues/41619 is implemented and libstd (and thus the ecosystem) expectations change with regards to what looks "portable".
I don't know why I didn't consider just .into
ing it. That's way easier, thanks!
Sometimes it would be convenient to keep the safer lifetime-bound API, but adjust the way the library gets loaded (e.g. to use eager binding). Add
Library::new_with_flags
and aLoadFlags
type to provide an easier way to do this.