rs-basic/README.md

74 lines
2.3 KiB
Markdown
Raw Normal View History

2023-09-12 17:01:33 +02:00
# Rust basics
2024-01-12 14:57:50 +01:00
This project contains various smaller rust projects, often made by myself to
2024-06-27 14:15:44 +02:00
gain more understanding with a topic or dependency. It contains the absolute
basics of the language, the more advanced topics, but also demos on various
dependencies.
Completeness is not a goal of this project.
2025-03-14 22:24:47 +01:00
## Compiling
Please prefer the use of the [cargo.sh](./cargo.sh) script.
```bash
$ ./cargo.sh CRATE CARGO_COMMANDS...
```
## Highlighted demo crates
2024-06-27 14:15:44 +02:00
**Basics**
* [echargs](./members/echargs/)
* [shortc](./members/shortc/)
* [hello-world](./members/hello-world/)
* [revsqrt](./members/revsqrt/)
**Intermediate**
* [mpsc](./members/mpsc/)
* [mpsc-full](./members/mpsc-full/)
* [panic-calm](./members/panic-calm/)
* [socker](./members/socker/)
**Dependencies**
* [serde-json-demo](./members/serde-json-demo/) (for `serde` and `serde_json`)
* [claptest](./members/claptest/) (for `clap`)
* [ptlog](./members/ptlog/) (for `libpt`)
* [sqlite-demo](./members/sqlite-demo/) (for `rusqlite`)
* [onlytoken](./members/onlytoken/) (for `rand` and `argon2`)
2024-06-27 14:15:44 +02:00
**Advanced Dependencies**
2024-06-27 17:25:56 +02:00
* [diesel-demo](./members/diesel-demo/) (for `diesel` and CLI dependencies)
* [tokio-send-sync](./members/tokio-send-sync/) (for `tokio`)
* [tokryon](./members/tokryon/) (for `tokio` and `rayon`)
* [cucumber-demo](./members/cucumber-demo/) (for `cucumber`)
* [criterion-demo](./members/criterion-demo/) (for `criterion`)
* [revsqrt](./members/revsqrt/) (the bench and tests, for `criterion` and `cucumber`)
* [rest](./members/rest/) (for `serde`, `tokio` and `warp`)
* [rest-queued](./members/rest-queued/) (for `serde`, `tokio` and `warp`)
2023-09-12 17:01:33 +02:00
2024-08-12 13:37:51 +02:00
## Warnings
2025-03-14 22:24:47 +01:00
* Some of the crates, especially those related to GUIs, may not work in WSL
2024-08-12 13:37:51 +02:00
environments.
2025-03-14 22:24:47 +01:00
## Additional dependencies
If you need to compile the whole workspace:
```bash
apt install libgtk-3-dev librust-atk-dev -y
```
2024-01-12 14:57:50 +01:00
## Rust unsafe
2023-09-12 17:01:33 +02:00
2024-01-12 14:57:50 +01:00
Unsafe rust offers many possibilities otherwise locked from rust, which might
cause undefined behavior (or are dubbed unsafe for other reasons). Let's be
2024-06-27 14:15:44 +02:00
honest, they are often hacks. But they can have fun uses and are sometimes
interesting to explore, if only to see how the underlying system works.
Unsafe rust also has important uses when using programs developed in other
languages (like C or C++) or when manipulation of bits, bytes, and memory is
in needed (sorting algorithms).
See [rs-unsafe](rs-unsafe) for more.