Closed MatrixDev closed 2 years ago
The behaviour between the two environments is sufficiently distinct in what symbols are made available that a common cross-platform wrapper isn't really feasible.
The documentation for the methods calls it out too.
Thanks for a quick reply. You can close this issue if there are really no common symbols that can be accessed.
Thank you for taking time to request a change regardless.
Currently Library struct has only one method for creation -
Library::new()
. It would be really nice to addLibrary::this()
as well. It is already implemented for unix and windows anyways.So instead of writing this:
Users can just simply write:
Yes,
libloading::os::unix::Library::this()
cannot fail. But it doesn't really matter when you're writing cross-platform code, as you need to handle errors from everywhere anyways. This can be considered as a very useful helper.