Enumeration
TorEvent
Lifecycle and protocol events surfaced by TorClient and TorSession.
enum TorEvent
Overview
TorEvent is the Swift-side projection of Tor’s control-protocol async events (control-spec.txt §4) plus swift-tor’s own state transitions. It flattens heterogeneous sources — bootstrap progress, log messages, state changes, and circuit/stream status — into a single Sendable enum so UI code can subscribe to one AsyncStream and pattern-match once.
The enum does not cover every control-protocol event Tor can emit; only the high-level events that map cleanly to end-user UX or state machines are surfaced here. For the complete raw-event set, subscribe via subscribe(to:) and receive TorControlEventMessage values directly.
Note
Events are delivered in causal order per events. A .stateChanged(.running) is never observed before the .stateChanged(.starting) that preceded it.
Important
The stream has no replay. Subscribers that start late will miss earlier events — capture the initial state via state when opening the iterator.
Topics
Cases