# `Phoenix.HTML.Safe`
[🔗](https://github.com/phoenixframework/phoenix_html/blob/v4.4.0/lib/phoenix_html/safe.ex#L1)

Defines the HTML safe protocol.

In order to promote HTML safety, Phoenix templates
do not use `Kernel.to_string/1` to convert data types to
strings in templates. Instead, Phoenix uses this
protocol which must be implemented by data structures
and guarantee that a HTML safe representation is returned.

Furthermore, this protocol relies on iodata, which provides
better performance when sending or streaming data to the client.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `to_iodata`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
