IrohBeam. Stream
(iroh_beam v0.2.0)
View Source
Bounded QUIC stream with independent send and receive halves.
Every receive requires a positive byte limit. One mutable operation may be in
flight per half; conflicting calls return :busy, while opposite halves of a
bidirectional stream can progress concurrently.
Summary
Types
@type t() :: %IrohBeam.Stream{ direction: :uni | :bi, id: non_neg_integer(), owner: pid(), recv?: boolean(), resource: reference(), send?: boolean() }
Functions
@spec abort(t(), non_neg_integer()) :: :ok | {:error, IrohBeam.Error.t()}
@spec finish(t()) :: :ok | {:error, IrohBeam.Error.t()}
@spec id(t()) :: non_neg_integer()
@spec info(t()) :: {:ok, map()} | {:error, IrohBeam.Error.t()}
@spec recv(t(), pos_integer(), keyword()) :: {:ok, binary()} | :eof | {:error, IrohBeam.Error.t()}
@spec recv_to_end(t(), pos_integer(), keyword()) :: {:ok, binary()} | {:error, IrohBeam.Error.t()}
@spec reset(t(), non_neg_integer()) :: :ok | {:error, IrohBeam.Error.t()}
@spec send(t(), binary(), keyword()) :: :ok | {:error, IrohBeam.Error.t()}
@spec send_chunk(t(), binary(), keyword()) :: {:ok, pos_integer()} | {:error, IrohBeam.Error.t()}
@spec stop(t(), non_neg_integer()) :: :ok | {:error, IrohBeam.Error.t()}