Tags→#rust
Everything I've written about Rust, from ownership, lifetimes, and error handling to async, threads, and the Rust behind IOTA's proof of inclusion.
Building IOTA's Proof of Inclusion with Rust
One Rust trait for native and WebAssembly, a proof format ready for new versions, and a committee cache that only holds what was verified.
Bringing IOTA's gRPC API to Node.js for Proof of Inclusion
Generate a pinned TypeScript client from IOTA's protobuf schema, keep it to raw bytes, and let Rust compiled to WebAssembly decode them.
Passing Results Between Rust Threads with Channels
Send owned values from worker threads through standard-library channels, and close every sender so the receiver can finish.
Borrowing Data in Scoped Rust Threads
Use std::thread::scope to share borrowed inputs with short-lived threads and safely split mutable data between workers.
Modeling State with Rust Enums
Use enum variants to describe valid states, carry the data each state needs, and make transitions explicit with pattern matching.
Reading Lifetimes as Relationships in Rust
Understand what lifetime annotations say about borrowed values, with small examples of returned references and borrowed fields.
Deref and DerefMut: Rust's Smart Pointer Protocol
How Deref and DerefMut let String, Vec, and Box act like the data they hold, how to implement them for your own types, and when not to.
Rust Iterators: Borrow, Transform, and Collect
A practical guide to iter, iter_mut, and into_iter, with readable examples of filtering, mapping, and collecting values.
Handling Recoverable Errors with Result in Rust
Learn when to handle an error, when to return it, and how the question mark operator keeps fallible Rust code readable.
Understanding Pin in Rust: Move Semantics and Safety
What Pin guarantees, why self-referential futures need it, and how to pin values safely when writing async Rust, with a stream example.