Skip to content

dariuswiles/rust-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Short programs to implement specific solutions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages