<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorControlEventMessage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A19ControlEventMessageV"
  },
  "title" : "TorControlEventMessage"
}
-->

# TorControlEventMessage

A parsed 650-status async reply from the Tor control protocol.

```
struct TorControlEventMessage
```

## Overview

`TorControlEventMessage` is the raw, typed representation of a single
`SETEVENTS` delivery. It carries the event kind, the verbatim payload
line Tor sent, and a lazily-parsed attribute dictionary for
`key=value` fields that appear in most events (circuit status,
bandwidth totals, etc.).

Most callers should subscribe to [`events`](/documentation/Tor/TorSession/events) instead and
receive curated [`TorEvent`](/documentation/Tor/TorEvent) values. Use `TorControlEventMessage`
when you need access to an event field that swift-tor has not yet
promoted into the high-level enum.

> Note: Conformance is `Sendable`; all three fields are value types
> and safely cross concurrency domains.

> Important: `attributes` is **opportunistic** — the parser extracts
> `key=value` and `key="quoted value"` pairs from `data` on a best-effort
> basis per control-spec.txt §2.3. Events whose payload is not a
> `key=value` list will have an empty dictionary and full content in
> `data`.

## Topics

### Creating

[`init(event:data:attributes:)`](/documentation/Tor/TorControlEventMessage/init(event:data:attributes:))

Memberwise initialiser — usually called by the control-protocol
parser, not end-user code.

### Inspection

[`event`](/documentation/Tor/TorControlEventMessage/event)

The protocol-level event kind carried by this message.

[`data`](/documentation/Tor/TorControlEventMessage/data)

Tor’s verbatim payload line after the event keyword.

[`attributes`](/documentation/Tor/TorControlEventMessage/attributes)

Opportunistically-parsed `key=value` attribute dictionary.

