# `Kombu.Binding`
[🔗](https://github.com/hacktobeer/kombu/blob/v0.1.0/lib/kombu/entity/binding.ex#L1)

Represents a queue or exchange binding (`kombu.entity.binding`).

# `t`

```elixir
@type t() :: %Kombu.Binding{
  arguments: map() | nil,
  exchange: Kombu.Exchange.t() | nil,
  routing_key: String.t(),
  unbind_arguments: map() | nil
}
```

# `as_dict`

```elixir
@spec as_dict(t(), keyword()) :: map()
```

Converts the binding to a map representation.

# `bind`

```elixir
@spec bind(t(), struct(), keyword()) :: :ok
```

Binds an entity (`%Kombu.Queue{}` or `%Kombu.Exchange{}`) using this binding.

# `bound?`

```elixir
@spec bound?(t()) :: boolean()
```

Checks if the binding is bound to a channel.

# `can_cache_declaration?`

```elixir
@spec can_cache_declaration?(t()) :: boolean()
```

Checks if the declaration can be cached.

# `declare`

```elixir
@spec declare(t(), pid() | nil, keyword()) :: :ok
```

Declares the target exchange on `channel` if `binding.exchange` is present.

# `new`

```elixir
@spec new(Kombu.Exchange.t() | String.t() | nil, keyword()) :: t()
```

Creates a new `%Kombu.Binding{}`.

# `new`

```elixir
@spec new(Kombu.Exchange.t() | String.t() | nil, String.t(), keyword()) :: t()
```

Creates a new `%Kombu.Binding{}` with exchange, routing_key, and additional opts.

# `unbind`

```elixir
@spec unbind(t(), struct(), keyword()) :: :ok
```

Unbinds an entity (`%Kombu.Queue{}` or `%Kombu.Exchange{}`) from this binding.

---

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