---
title: "encode(to:)"
framework: permissionkit
role: symbol
role_heading: Instance Method
path: "permissionkit/communicationtopic/personinformation-swift.struct/encode(to:)"
---

# encode(to:)

Performs the inverse of the decoding process.

## Declaration

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

## Parameters

- `encoder`: The encoder to use when encoding this value.
