Want true pub-sub semantics in Rust?
The Bus crate gives you SP→MC broadcast semantics.
Crossbeam’s MPSC supports multiple consumers, but it round-robins messages, not exactly what you want for fan-out.
crates.io/crates/bus
#119 (contd.)
- imposes runtime cost by stack walking
- encourages using panic for control flow
- many APIs are not unwind-safe
- cannot catch "fatal" errors such as out-of-memory
🦀 #Rust Tip #119:
Some folks suggest using std::panic::catch_unwind as a solution to the recent unwrap() panic that stopped the internet.
In my opinion this is an anti-pattern, some thoughts:
- bypasses memory safety constraints (e.g., panic in unsafe block)
Daily Rust retweeted
You generally want a Clippy linter like this one in your Rust production code
🦀 Bad news everyone - unwrap() is the reason behind cloudflare outage
>The FL2 Rust code that makes the check and was the source of the unhandled error is shown below
blog.cloudflare.com/18-novem…
Daily Rust retweeted
Animate anything with Rust 🦀
🌀 KramaFrame — A simple, generic, and flexible keyframe animation library.
⚡ Manage multiple animations, apply easing functions, and map progress to any range.
🐁 Includes a terminal demo w/ @ratatui_rs
⭐ GitHub: github.com/CosmoBunny/kramaf…
#rustlang #animation #library #programming #terminal #ratatui #tui
Daily Rust retweeted
This is gold if you're using async Rust 💯
🌀 channels-console — A TUI dashboard for inspecting std/tokio/futures/crossbeam channels.
📊 Watch messages, queue depth, throughput & memory usage live.
🦀 Written in Rust & built with @ratatui_rs
⭐ GitHub: github.com/pawurb/channels-c…
#rustlang #ratatui #tui #async #concurrency #tokio #debugging
🦀 #Rust Tip #118:
Result::and_then lets us chain operations that return Result, bypassing nested pattern matching. Although the ? operator often accomplishes the same, and_then allows us to remain in a more functional "combinator style".
Not sure I follow 100%, if statements don't need round parens, for example.
Also, try a C++ closure
auto add = [&sum](int v){ sum += v; };
ampersand and all types of possible parens
Rust:
let mut add = |v| { total += v; };
IMHO the killer features of Rust are the high-level abstractions baked in at "Zero Cost", with much better ergonomics (==readability) than equivalent features e.g., in C++. Memory safety is just an additional safeguard the compiler provides.










