
Rust-examples is a repository to gather example codes from tutorial and other documentations of Rust into files, ready to compile.
Examples are tested with version 1.13.0.
what_it_looks_like.rs, what_it_looks_like2.rs, what_it_looks_like3.rstutorial-02_1-hello.rstutorial-03-syntax_basics.rstutorial-04_2-pattern-matching.rsfor, while, loop): tutorial-04_3-loops.rstutorial-05_1-structs.rstutorial-05_2-enum.rstutorial-05_3-tuples.rstutorial-15-closure.rstutorial-16-methods.rstutorial-17-generics.rstutorial-tasks-02_1-communication.rstutorial-tasks-02_3-arc.rsbook-5-6-threads.rsunittests.rsphantom_type.rslang-interface.rslang-lambda.rslang-generics.rslang-overloading.rslang-pointers.rslang-question_mark.rsapi-collections-hashmap.rsapi-getopts.rsapi-std-from_str.rsapi-std-fs-file.rsapi-std-vec.rsMakefile to compile, run tests and run benchmarks.travis.yml to add the repository to Travis CI and Rust CIfibonacci.rsdate.rsfind_max.rsinifile.rsdatumbazo2tbx.rsdesign_pattern-decorator.rs and design_pattern-decorator2.rsdesign_pattern-strategy.rsdesign_pattern-observer.rsdesign_pattern-command.rsdesign_pattern-templatemethod.rsdesign_pattern-chain_of_command.rsYou will need the version 1.3.0 of the rust compiler. If you encounter problems, make sure you have the right version before creating an issue.
The simplest way to build rust-examples is to do a clone and use make to compile:
git clone https://github.com/eliovir/rust-examples
cd rust-examples
make
To run tests and benchmarks:
make tests
make bench
To get help on commands:
make help
git clone https://github.com/eliovir/rust-examples)git checkout -b my-new-feature)make test)git commit -am 'Add some feature')git push origin my-new-feature)other projects have similar goals: providing Rust code snippets:
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
These codes are distributed under the MIT license.
See LICENSE for details.
$ claude mcp add rust-examples \
-- python -m otcore.mcp_server <graph>