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

# encode(to:)

Performs encoding of the value using the given encoder.

## Declaration

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

## Parameters

- `encoder`: The encoder to write to.

## See Also

### Decoding and encoding

- [init(from:)](alarmkit/alarmattributes/init(from:).md)
