# `Kombu.Transport.Virtual.BrokerState`
[🔗](https://github.com/hacktobeer/kombu/blob/v0.1.0/lib/kombu/transport/virtual/broker_state.ex#L1)

Holds virtual broker exchanges, bindings, and queue indices
(`kombu.transport.virtual.base.BrokerState`).

# `binding_key`

```elixir
@type binding_key() :: {String.t(), String.t(), String.t()}
```

# `queue_binding`

```elixir
@type queue_binding() :: {String.t(), String.t(), map() | nil}
```

# `t`

```elixir
@type t() :: %Kombu.Transport.Virtual.BrokerState{
  bindings: %{required(binding_key()) =&gt; map() | nil},
  exchanges: %{required(String.t()) =&gt; map()},
  queue_index: %{required(String.t()) =&gt; MapSet.t(binding_key())}
}
```

# `append_table`

```elixir
@spec append_table(t(), String.t(), {String.t(), String.t() | nil, String.t()}) :: t()
```

Appends a routing table entry `{routing_key, pattern, queue}` to `exchange`.

# `binding_declare`

```elixir
@spec binding_declare(t(), String.t(), String.t(), String.t(), map() | nil) :: t()
```

Declares a binding `(queue, exchange, routing_key)` with `arguments`.

# `binding_delete`

```elixir
@spec binding_delete(t(), String.t(), String.t(), String.t()) :: t()
```

Deletes a binding `(queue, exchange, routing_key)`.

# `clear`

```elixir
@spec clear(t()) :: t()
```

Clears all exchanges, bindings, and queue indices.

# `delete_exchange`

```elixir
@spec delete_exchange(t(), String.t()) :: t()
```

Deletes an exchange from `state.exchanges`.

# `has_binding?`

```elixir
@spec has_binding?(t(), String.t(), String.t(), String.t()) :: boolean()
```

Returns `true` if `(queue, exchange, routing_key)` is bound.

# `new`

```elixir
@spec new(map()) :: t()
```

Creates a new `%BrokerState{}`.

# `put_exchange`

```elixir
@spec put_exchange(t(), String.t(), map()) :: t()
```

Puts or updates an exchange entry in `state.exchanges`.

# `queue_bindings`

```elixir
@spec queue_bindings(t(), String.t()) :: [queue_binding()]
```

Returns a list of `{exchange, routing_key, arguments}` tuples for `queue`.

# `queue_bindings_delete`

```elixir
@spec queue_bindings_delete(t(), String.t()) :: t()
```

Deletes all bindings for `queue`.

# `remove_from_table`

```elixir
@spec remove_from_table(t(), String.t(), {String.t(), String.t() | nil, String.t()}) ::
  t()
```

Removes `meta_tuple` from `exchange`'s routing table.

---

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