Antd.DownloadFrame (antd v0.4.1)

Copy Markdown View Source

One frame of a progress-enabled streaming download: the total size, a plaintext data chunk, or a Antd.DownloadProgress update. At most one of :meta, :data, or :progress is set. Yielded by the *_with_progress streaming methods; the plain data_stream methods stay a pure binary stream for callers that don't need progress.

:meta is the total download size in bytes — the progress denominator, surfaced from the gRPC x-content-length response header or the REST NDJSON meta frame. Emitted at most once, before any data.

Summary

Functions

True if this frame carries the total-size denominator (in bytes).

True if this frame carries a progress update rather than data bytes.

Types

t()

@type t() :: %Antd.DownloadFrame{
  data: binary() | nil,
  meta: non_neg_integer() | nil,
  progress: Antd.DownloadProgress.t() | nil
}

Functions

meta?(download_frame)

@spec meta?(t()) :: boolean()

True if this frame carries the total-size denominator (in bytes).

progress?(download_frame)

@spec progress?(t()) :: boolean()

True if this frame carries a progress update rather than data bytes.