---
title: "encode(to:)"
framework: distributed
role: symbol
role_heading: Instance Method
path: "distributed/distributedactor/encode(to:)"
---

# encode(to:)

Encodes the actor.id as a single value into the passed encoder.

## Declaration

```swift
nonisolated func encode(to encoder: any Encoder) throws
```
