I'm happy to announce battery crate --- cross-platform library for reading batteries information.
Right now it supports Linux, Mac OS, Windows, FreeBSD and DragonFlyBSD.
Here is an example what data you can fetch on these platforms (made with the assistant crate battery-cli):
Check out GitHub repo, documentation or my blog post with additional details.