# `ASM.Extensions.Rendering.Sink`
[🔗](https://github.com/nshkrdotcom/agent_session_manager/blob/v0.9.2/lib/asm/extensions/rendering/sink.ex#L1)

Behaviour for sink destinations that receive rendered iodata and events.

# `opts`

```elixir
@type opts() :: keyword()
```

# `state`

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

# `close`

```elixir
@callback close(state()) :: :ok | {:error, ASM.Error.t() | term()}
```

# `flush`

```elixir
@callback flush(state()) ::
  {:ok, state()}
  | {:error, ASM.Error.t() | term()}
  | {:error, ASM.Error.t() | term(), state()}
```

# `init`

```elixir
@callback init(opts()) :: {:ok, state()} | {:error, ASM.Error.t() | term()}
```

# `write`

```elixir
@callback write(iodata(), state()) ::
  {:ok, state()}
  | {:error, ASM.Error.t() | term()}
  | {:error, ASM.Error.t() | term(), state()}
```

# `write_event`

```elixir
@callback write_event(ASM.Event.t(), iodata(), state()) ::
  {:ok, state()}
  | {:error, ASM.Error.t() | term()}
  | {:error, ASM.Error.t() | term(), state()}
```

---

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