News for hackers. Stuff that matters.
Re:Ask HN: Has any Rust developer moved to embedded device p... by markjgx on Wednesday August 17, 2022 @08:38AM (#32495450)
> Managing build configurations...

In terms of package management, you can apply rules to what crates you want to include; including specific platform constraints.

  [target.'cfg(target_os = "linux")'.dependencies]
  nix = "0.5"
On the code side it's pretty much the same as C++. You have a module that defines an interface and per-platform implementations that are included depending on a "configuration conditional check" #[cfg(target_os = "linux")] macro.

https://github.com/tokio-rs/mio/blob/c6b5f13adf67483d927b176...

There are no comments on this comment yet.