3 ms·
Anecdotally, the use cases I've had are all clearly in one category or the other: I'm either building firmware for an embedded device, or building a PC applicat
by the__alchemist 2y ago
Anecdotally, the use cases I've had are all clearly in one category or the other: I'm either building firmware for an embedded device, or building a PC application. I'm curious about the overlap cases.
- mlsu 2y agoI’ve used it in the past for creating a shared messaging crate that has packet definitions, handshake logic, serialization/deserialization. I think with sloppy/complex code it could start to resemble #ifdef PLATFORM complexity if you do a lot inline, but cargo workspaces are a good way to reduce the blast radius.
- gibibit 2y agoYou're right that an application project (a `binary crate` in Rust parlance) for embedded firmware versus a PC application is very different. But library crates are often usable in both an embedded or system-level context or in a full-fledged desktop GUI application. Consider these common libraries you might use in either a `std` project (PC application, web microservice) or `no_std` project (embedded microcontroller firmware, bootloader, Linux kernel module, blockchain smart contract): - data encoding (https://crates.io/crates/base64 https://crates.io/crates/base64 for instance), - hashing (SHA2 https://github.com/RustCrypto/hashes/tree/master/sha2 https://github.com/RustCrypto/hashes/tree/master/sha2), - data structures (https://github.com/Lokathor/tinyvec https://github.com/Lokathor/tinyvec) - time/date manipulation (https://docs.rs/chrono/latest/chrono/ https://docs.rs/chrono/latest/chrono/)
- burntsushi 2y agoAs of recently, Jiff with time zone support can now be used in a no_std project. :-) https://docs.rs/jiff/latest/jiff/tz/index.html#core-only-environments https://docs.rs/jiff/latest/jiff/tz/index.html#core-only-env...
- gibibit 2y agoAmazing, thanks! To anyone who hasn't tried it yet... Jiff is a fantastic time and date crate, I highly recommend you check it out, as a possible improvement over chrono and time.