# willzhang05/learning-rust architecture

> Architecture diagram of the GitHub repository willzhang05/learning-rust, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/willzhang05/learning-rust
- Repository: https://github.com/willzhang05/learning-rust

## Overview

This repository is a collection of independent Rust learning samples, not one integrated product. Its examples demonstrate FizzBuzz output, tree traversal, N-Queens scaffolding, filesystem event watching, and small system-query/hello-world programs. The main user-to-result pattern is running a standalone example and observing its output; the inotify sample additionally accepts a watched path and prints events. Some samples are incomplete or disconnected at runtime (notably the N-Queens solver call is commented out).

Main entry points: [`nqueens.rs`](https://github.com/willzhang05/learning-rust/blob/master/nqueens.rs) (N-Queens), [`node.rs`](https://github.com/willzhang05/learning-rust/blob/master/node.rs) (Tree traversal), [`inotifytest/src/main.rs`](https://github.com/willzhang05/learning-rust/blob/master/inotifytest/src/main.rs) (File watcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basic["Basic examples"]
  node_fizzbuzz["FizzBuzz<br/>[fizzbuzz.rs]"]
end

subgraph group_algorithms["Algorithm examples"]
  node_tree["Tree traversal<br/>[node.rs]"]
  node_queens["N-Queens<br/>[nqueens.rs]"]
end

subgraph group_system["System examples"]
  node_watcher["File watcher<br/>[main.rs]"]
  node_inotify{{"Linux inotify"}}
end

subgraph group_spec["Spec samples"]
  node_specjson_lib["Sysctl sample<br/>[specjson.rs]"]
  node_specjson_main["Hello-world sample<br/>[main.rs]"]
end

node_tree -->|"runs DFS"| node_tree
node_queens -->|"prints board"| node_queens
node_queens -->|"recurses; checks validity"| node_queens
node_watcher -->|"registers watch; reads events"| node_inotify

click node_fizzbuzz "https://github.com/willzhang05/learning-rust/blob/master/fizzbuzz.rs"
click node_tree "https://github.com/willzhang05/learning-rust/blob/master/node.rs"
click node_queens "https://github.com/willzhang05/learning-rust/blob/master/nqueens.rs"
click node_watcher "https://github.com/willzhang05/learning-rust/blob/master/inotifytest/src/main.rs"
click node_specjson_lib "https://github.com/willzhang05/learning-rust/blob/master/specjson/specjson.rs"
click node_specjson_main "https://github.com/willzhang05/learning-rust/blob/master/specjson/src/main.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fizzbuzz toneBlue
class node_tree,node_queens toneAmber
class node_watcher,node_inotify toneMint
class node_specjson_lib,node_specjson_main toneRose
```

## Components

### Basic examples

- [FizzBuzz](https://github.com/willzhang05/learning-rust/blob/master/fizzbuzz.rs): `fizzbuzz.rs`

### Algorithm examples

- [Tree traversal](https://github.com/willzhang05/learning-rust/blob/master/node.rs): `node.rs`
- [N-Queens](https://github.com/willzhang05/learning-rust/blob/master/nqueens.rs): `nqueens.rs`

### System examples

- [File watcher](https://github.com/willzhang05/learning-rust/blob/master/inotifytest/src/main.rs): `inotifytest/src/main.rs`
- **Linux inotify**

### Spec samples

- [Sysctl sample](https://github.com/willzhang05/learning-rust/blob/master/specjson/specjson.rs): `specjson/specjson.rs`
- [Hello-world sample](https://github.com/willzhang05/learning-rust/blob/master/specjson/src/main.rs): `specjson/src/main.rs`

## Connections

- Tree traversal → Tree traversal: runs DFS (evidence: `node.rs`)
- N-Queens → N-Queens: prints board (evidence: `nqueens.rs`)
- N-Queens → N-Queens: recurses; checks validity (evidence: `nqueens.rs`)
- File watcher → Linux inotify: registers watch; reads events (evidence: `inotifytest/src/main.rs`)
