The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →
Top 6 Rust Platform specific Projects
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
If we drop std Rust ceases to be economical due to the time it would take to reimplement the data structures and IO interfaces it provides, not to mention the event loop crate we use (calloop). At that point we'd be relying on so much FFI via eg. nix that the relative safety would be diminished too. After reimplementing all that it's not clear to me that we'd even save that much size, but I suppose it's possible.
Project mention: Improving Interoperability Between Rust and C++ | news.ycombinator.com | 2024-02-05Vtables are pretty solved as well. I do a lot of Windows COM interop. Using the `windows` crate, vtables for COM interfaces are relegated to an implementation detail - instead you simply implement a (typically safe!) trait:
https://microsoft.github.io/windows-docs-rs/doc/windows/Win3...
Which can then be converted to a refcounted smart pointer:
https://microsoft.github.io/windows-docs-rs/doc/windows/Win3...
All driven by win32 sdk parsing and metadata.
But suppose we want to roll our own, because we tend to prefer `winapi` but it lacks definition. That's not too terrible either:
• https://github.com/MaulingMonkey/thindx-xaudio2/blob/master/...
• https://github.com/MaulingMonkey/thindx-xaudio2/blob/master/...
• https://github.com/MaulingMonkey/thindx-xaudio2/blob/master/...
I could more heavily lean on my macros ala `windows`, but I went the route of manual control for better doc comments, more explicit control of thread safety traits to match the existing C++ codebase, etc.
Is there some pointer casting? Yes. Is it annoying or likely to be what breaks? No. What is annoying?
• Stacked borrows and narrowing spatial provenance ( https://github.com/retep998/winapi-rs/issues/1025 - this can be "solved" by sticking to pointers ala `windows`, or by choosing a different provenance model like rustc might be doing?)
• Guarding against panics unwinding over an FFI boundary. This is at least being worked on, but remains unfinished ( https://rust-lang.github.io/rfcs/2945-c-unwind-abi.html )
• Edge case ABI weirdness specific to C++ methods ( https://devblogs.microsoft.com/oldnewthing/20220113-00/?p=10... , https://github.com/retep998/winapi-rs/issues/523 )
Rust Platform specific related posts
- Improving Interoperability Between Rust and C++
- I was wrong about rust
- The guide to signal handling in Rust
- Trying to compile rust library on Windows
- [Quick Poll] Are You Using Nix for Your Rust Open-Source Projects?
- I seen people say that () is similar to void in C. But what is similar to void*?
- Kernel Headers for Windows could soon make it into windows-rs
-
A note from our sponsor - WorkOS
workos.com | 26 Apr 2024
Index
What are some of the best open-source Platform specific projects in Rust? This list will help you:
Project | Stars | |
---|---|---|
1 | nix | 2,526 |
2 | winapi-rs | 1,795 |
3 | rust-fuse | 1,028 |
4 | inotify-rs | 245 |
5 | rust-iptables | 81 |
6 | sys-mount | 40 |
Sponsored