QuicHttp3.Transport behaviour (elixir_quic_http3 v0.16.0)

View Source

Narrow transport contract consumed by the HTTP/3 session layer.

Implementations provide QUIC operations only. HTTP/3 frame parsing, QPACK, control streams, and request streams remain in QuicHttp3.

Summary

Types

connection()

@type connection() :: term()

failure()

@type failure() :: {:error, term()} | {:blocked, term()} | {:unknown, reference()}

options()

@type options() :: keyword()

stream()

@type stream() :: term()

Callbacks

capabilities()

@callback capabilities() :: map()

client(options)

@callback client(options()) :: {:ok, pid()} | failure()

close(connection, non_neg_integer, binary, options)

@callback close(connection(), non_neg_integer(), binary(), options()) :: :ok | failure()

connect(arg1, port_number, options)

@callback connect(binary() | :inet.ip_address(), :inet.port_number(), options()) ::
  {:ok, connection()} | failure()

events(connection, pos_integer, options)

@callback events(connection(), pos_integer(), options()) :: {:ok, list()} | failure()

open_stream(connection, arg2, options)

@callback open_stream(connection(), :bidi | :uni, options()) ::
  {:ok, stream()} | failure()

read(stream, pos_integer, options)

@callback read(stream(), pos_integer(), options()) :: {:ok, list()} | failure()

read_datagrams(connection, pos_integer, options)

@callback read_datagrams(connection(), pos_integer(), options()) ::
  {:ok, [binary()]} | failure()

ready(connection, timeout)

@callback ready(connection(), timeout()) :: :ready | :pending | failure()

reset_stream(stream, non_neg_integer, options)

@callback reset_stream(stream(), non_neg_integer(), options()) ::
  {:ok, reference()} | :ok | failure()

send_datagram(connection, binary, options)

@callback send_datagram(connection(), binary(), options()) ::
  {:ok, reference()} | failure()

send_stream(stream, binary, boolean, options)

@callback send_stream(stream(), binary(), boolean(), options()) ::
  {:ok, reference()} | :ok | failure()

stop_endpoint(pid)

@callback stop_endpoint(pid()) :: :ok | {:error, term()}

stop_stream(stream, non_neg_integer, options)

@callback stop_stream(stream(), non_neg_integer(), options()) ::
  {:ok, reference()} | :ok | failure()