Derive Serialize/Deserialize and round-trip a struct.
All snippets
The latest code snippets.
Async HTTP GET with the popular reqwest crate and tokio runtime.
Persist a string atomically using std::fs::write.
Read an entire file into a String using std::fs::read_to_string.
Stdlib Minitest spec — no extra gems needed.
Cache an expensive call with the `||=` idiom.
Generate a v4 UUID with the SecureRandom stdlib.
Parse CLI flags with the stdlib OptionParser.
Fan out HTTP calls across threads and join them.
Define a model and run a chained where/order query with ActiveRecord.