Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.07 KB

README.md

File metadata and controls

27 lines (20 loc) · 1.07 KB

Rust Snippets

I'm using this repo to collect short Rust programs that I've written to solve specific problems when working on larger projects. e.g., to add multi-threading. I'm still learning Rust so the code can undoubtedly be improved. The repo is only intended for my use, but it's public on the off-chance it is useful to others.

Repo Structure and Use

Each snippet is in its own Cargo crate, which also means its own sub-directory. If you are at the top level and using Bash, a snippet can be run with:

cargo run -p thread-worker

Alternatively, you can cd into a crate and use:

cargo run

Snippets

Directory Name Snippet Description
generic-struct-functions Demonstrates the ability of a generic struct to have different implementations of a function with the same name but for different types.
thread-worker A simple, multi-threaded worker. Chapter 20.3 of The Rust Programming Language has a more generic example along similar lines.