# SessionID.encode(to:)

- **Module:** SessionID
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Identity.swift#L54
- **Page:** https://libtmux.org/reference/swift/sessionid-encode(to-)/

```
SessionID.encode(to:)(to: any Encoder) -> ()
```

Encodes this value into the given encoder.

If the value fails to encode anything, `encoder` will encode an empty
keyed container in its place.

This function throws an error if any values are invalid for the given
encoder's format.

- Parameter encoder: The encoder to write data to.
