Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cookin’ with Rust

This Rust Cookbook is a collection of simple examples that demonstrate good practices to accomplish common programming tasks, using the crates of the Rust ecosystem.

Read more about Rust Cookbook, including tips for how to read the book, how to use the examples, and notes on conventions.

Contributing

This project is intended to be easy for new Rust programmers to contribute to, and an easy way to get involved with the Rust community. It needs and welcomes help. For details see CONTRIBUTING.md.

Algorithms

Asynchronous

Command Line

Compression

Concurrency

Cryptography

Data Structures

Database

Date and Time

Development Tools

Debugging

Versioning

Build Time

Encoding

File System

Hardware Support

RecipeCratesCategories
Check number of logical cpu coresnum_cpus-badgecat-hardware-support-badge

Memory Management

Networking

RecipeCratesCategories
Listen on unused port TCP/IPstd-badgecat-net-badge

Operating System

Science

science/mathematics

Text Processing

WebAssembly

wasmtime is an embeddable WebAssembly runtime. These recipes cover the host embedding API — loading modules, calling exports, sharing linear memory, and wiring up host-defined functions that guests can call back into.

The recipes live outside the main workspace because wasmtime is a large dependency not used elsewhere. Run them with cargo run --manifest-path crates/wasm/Cargo.toml --bin <name>.

Embedding wasmtime

Web Programming

Scraping Web Pages

Uniform Resource Locations (URL)

Media Types (MIME)

Clients

Web Authentication

RecipeCratesCategories
Basic Authenticationreqwest-badgecat-net-badge

Full Stack Web