Code Snippets

Language: Rust

Parse JSON with serde

Derive Serialize/Deserialize and round-trip a struct.

Author: chris

HTTP GET with reqwest

Async HTTP GET with the popular reqwest crate and tokio runtime.

Author: chris

Write a File in Rust

Persist a string atomically using std::fs::write.

Author: chris

Read a File to String in Rust

Read an entire file into a String using std::fs::read_to_string.

Author: chris