# `Pristine.Ports.Transport`
[🔗](https://github.com/nshkrdotcom/pristine/blob/pristine-v0.4.0/lib/pristine/ports/transport.ex#L1)

Transport boundary for sending requests.

`send/2` remains the only required callback. Existing adapters that implement
only `send/2` continue to support ordinary request execution.

Adapters may additionally advertise provider-neutral runtime capabilities with
`capabilities/1` and implement `send_cancelable/3`. Capability advertisement
must be side-effect free. Absence or malformed advertisement is unverified,
never implicit support.

Implementing `send_cancelable/3` alone is not proof of physical cancellation;
an adapter must only advertise cancellation capabilities that its owner has
verified through the underlying transport stack.

# `capabilities`
*optional* 

```elixir
@callback capabilities(Pristine.Core.Context.t()) :: map()
```

# `send`

```elixir
@callback send(Pristine.Core.Request.t(), Pristine.Core.Context.t()) ::
  {:ok, Pristine.Core.Response.t()} | {:error, term()}
```

# `send_cancelable`
*optional* 

```elixir
@callback send_cancelable(
  Pristine.Core.Request.t(),
  Pristine.Core.Context.t(),
  Pristine.Cancellation.t()
) ::
  {:ok, Pristine.Core.Response.t()} | {:error, term()}
```

---

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