# oferchen/rsync architecture

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

- Interactive diagram: https://gitdiagram.com/oferchen/rsync
- Repository: https://github.com/oferchen/rsync
- Video tour (about a minute): https://gitdiagram.com/oferchen/rsync/video

## Overview

oc-rsync is a Rust reimplementation of rsync, providing local, SSH, and daemon transfers with delta synchronization and metadata preservation. The main workflow starts with CLI arguments, configures and dispatches a client transfer, then compares file data and applies changes at the destination; daemon mode additionally accepts and authenticates connections. The graph includes the README’s major product capabilities. Relationships are limited where sampled source or explicit documentation supports them; several subsystems are represented by their exact enclosing paths because their implementation was not sampled.

Main entry points: [`crates/transfer/src/receiver/transfer/pipelined.rs`](https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/transfer/pipelined.rs) (Receive transfer), [`crates/cli/src/frontend/arguments/mod.rs`](https://github.com/oferchen/rsync/blob/master/crates/cli/src/frontend/arguments/mod.rs) (CLI options), [`crates/core/src/client/mod.rs`](https://github.com/oferchen/rsync/blob/master/crates/core/src/client/mod.rs) (Client orchestration), [`crates/daemon/src/daemon.rs`](https://github.com/oferchen/rsync/blob/master/crates/daemon/src/daemon.rs) (Daemon runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["CLI options<br/>[mod.rs]"]
end

subgraph group_transfer["Transfer runtime"]
  node_client["Client orchestration<br/>[mod.rs]"]
  node_remote["Remote transports<br/>[mod.rs]"]
  node_local["Local copy<br/>[pipelined_state.rs]"]
  node_receiver["Receive transfer<br/>[pipelined.rs]"]
  node_incremental["Incremental receive"]
end

subgraph group_delta["Delta and encoding"]
  node_signature["Signature generation<br/>[pipelined_gen.rs]"]
  node_checksums["Checksum algorithms<br/>[lib.rs]"]
  node_batch["Batch recording<br/>[lib.rs]"]
  node_compression["Compression<br/>[lib.rs]"]
end

subgraph group_daemon["Daemon service"]
  node_daemon["Daemon runtime<br/>[daemon.rs]"]
  node_daemon_config["Daemon configuration<br/>[config_parsing.rs]"]
end

subgraph group_support["Transfer capabilities"]
  node_filesystem[("Source and destination")]
  node_filters["Filters and selection<br/>[mod.rs]"]
  node_metadata["Metadata preservation<br/>[pipeline_setup.rs]"]
  node_bandwidth["Bandwidth limiting<br/>[lib.rs]"]
  node_applefs["Apple file metadata<br/>[lib.rs]"]
end

node_user(("User"))

node_user -->|"supplies options"| node_cli
node_cli -->|"configures transfer"| node_client
node_client -->|"dispatches local"| node_local
node_client -->|"dispatches remote"| node_remote
node_remote -->|"runs transfer"| node_receiver
node_local -->|"reads and writes"| node_filesystem
node_receiver -->|"reads and writes"| node_filesystem
node_receiver -->|"generates signatures"| node_signature
node_signature -->|"computes digests"| node_checksums
node_receiver -.->|"selects receive mode"| node_incremental
node_client -.->|"records or replays"| node_batch
node_receiver -.->|"encodes transfer data"| node_compression
node_cli -.->|"starts service"| node_daemon
node_daemon -->|"parses configuration"| node_daemon_config
node_daemon -->|"serves connections"| node_remote
node_cli -->|"parses rules"| node_filters
node_receiver -->|"uses transfer state"| node_metadata
node_receiver -.->|"limits transfer rate"| node_bandwidth
node_metadata -.->|"supports Apple metadata"| node_applefs

click node_cli "https://github.com/oferchen/rsync/blob/master/crates/cli/src/frontend/arguments/mod.rs"
click node_client "https://github.com/oferchen/rsync/blob/master/crates/core/src/client/mod.rs"
click node_remote "https://github.com/oferchen/rsync/blob/master/crates/core/src/client/remote/mod.rs"
click node_local "https://github.com/oferchen/rsync/blob/master/crates/engine/src/local_copy/pipelined_state.rs"
click node_receiver "https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/transfer/pipelined.rs"
click node_incremental "https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/transfer/pipelined_incremental.rs"
click node_signature "https://github.com/oferchen/rsync/blob/master/crates/signature/src/pipelined_gen.rs"
click node_checksums "https://github.com/oferchen/rsync/blob/master/crates/checksums/src/lib.rs"
click node_batch "https://github.com/oferchen/rsync/blob/master/crates/batch/src/lib.rs"
click node_compression "https://github.com/oferchen/rsync/blob/master/crates/compress/src/lib.rs"
click node_daemon "https://github.com/oferchen/rsync/blob/master/crates/daemon/src/daemon.rs"
click node_daemon_config "https://github.com/oferchen/rsync/blob/master/crates/daemon/src/daemon/sections/config_parsing.rs"
click node_filters "https://github.com/oferchen/rsync/blob/master/crates/cli/src/frontend/filter_rules/mod.rs"
click node_metadata "https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/pipeline_setup.rs"
click node_bandwidth "https://github.com/oferchen/rsync/blob/master/crates/bandwidth/src/lib.rs"
click node_applefs "https://github.com/oferchen/rsync/blob/master/crates/apple-fs/src/lib.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_cli,node_user toneBlue
class node_client,node_remote,node_local,node_receiver,node_incremental toneAmber
class node_signature,node_checksums,node_batch,node_compression toneMint
class node_daemon,node_daemon_config toneRose
class node_filesystem,node_filters,node_metadata,node_bandwidth,node_applefs toneIndigo
```

## Components

### User interface

- [CLI options](https://github.com/oferchen/rsync/blob/master/crates/cli/src/frontend/arguments/mod.rs): `crates/cli/src/frontend/arguments/mod.rs`

### Transfer runtime

- [Client orchestration](https://github.com/oferchen/rsync/blob/master/crates/core/src/client/mod.rs): `crates/core/src/client/mod.rs`
- [Remote transports](https://github.com/oferchen/rsync/blob/master/crates/core/src/client/remote/mod.rs): `crates/core/src/client/remote/mod.rs`
- [Local copy](https://github.com/oferchen/rsync/blob/master/crates/engine/src/local_copy/pipelined_state.rs): `crates/engine/src/local_copy/pipelined_state.rs`
- [Receive transfer](https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/transfer/pipelined.rs): `crates/transfer/src/receiver/transfer/pipelined.rs`
- [Incremental receive](https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/transfer/pipelined_incremental.rs): `crates/transfer/src/receiver/transfer/pipelined_incremental.rs`

### Delta and encoding

- [Signature generation](https://github.com/oferchen/rsync/blob/master/crates/signature/src/pipelined_gen.rs): `crates/signature/src/pipelined_gen.rs`
- [Checksum algorithms](https://github.com/oferchen/rsync/blob/master/crates/checksums/src/lib.rs): `crates/checksums/src/lib.rs`
- [Batch recording](https://github.com/oferchen/rsync/blob/master/crates/batch/src/lib.rs): `crates/batch/src/lib.rs`
- [Compression](https://github.com/oferchen/rsync/blob/master/crates/compress/src/lib.rs): `crates/compress/src/lib.rs`

### Daemon service

- [Daemon runtime](https://github.com/oferchen/rsync/blob/master/crates/daemon/src/daemon.rs): `crates/daemon/src/daemon.rs`
- [Daemon configuration](https://github.com/oferchen/rsync/blob/master/crates/daemon/src/daemon/sections/config_parsing.rs): `crates/daemon/src/daemon/sections/config_parsing.rs`

### Transfer capabilities

- **Source and destination**
- [Filters and selection](https://github.com/oferchen/rsync/blob/master/crates/cli/src/frontend/filter_rules/mod.rs): `crates/cli/src/frontend/filter_rules/mod.rs`
- [Metadata preservation](https://github.com/oferchen/rsync/blob/master/crates/transfer/src/receiver/pipeline_setup.rs): `crates/transfer/src/receiver/pipeline_setup.rs`
- [Bandwidth limiting](https://github.com/oferchen/rsync/blob/master/crates/bandwidth/src/lib.rs): `crates/bandwidth/src/lib.rs`
- [Apple file metadata](https://github.com/oferchen/rsync/blob/master/crates/apple-fs/src/lib.rs): `crates/apple-fs/src/lib.rs`

### Other components

- **User**

## Connections

- User → CLI options: supplies options
- CLI options → Client orchestration: configures transfer
- Client orchestration → Local copy: dispatches local
- Client orchestration → Remote transports: dispatches remote
- Remote transports → Receive transfer: runs transfer
- Local copy → Source and destination: reads and writes
- Receive transfer → Source and destination: reads and writes
- Receive transfer → Signature generation: generates signatures
- Signature generation → Checksum algorithms: computes digests
- Receive transfer → Incremental receive: selects receive mode
- Client orchestration → Batch recording: records or replays
- Receive transfer → Compression: encodes transfer data
- CLI options → Daemon runtime: starts service
- Daemon runtime → Daemon configuration: parses configuration
- Daemon runtime → Remote transports: serves connections
- CLI options → Filters and selection: parses rules
- Receive transfer → Metadata preservation: uses transfer state
- Receive transfer → Bandwidth limiting: limits transfer rate
- Metadata preservation → Apple file metadata: supports Apple metadata
