MingaAgent.Tool.Output.Range (Minga v0.1.0)

Copy Markdown View Source

Explicit zero-based bounds for a full capture, requested slice, or retained page.

Summary

Functions

Builds valid bounds. A known total must contain the selected interval.

Types

kind()

@type kind() :: :full | :requested | :page | :captured_prefix

t()

@type t() :: %MingaAgent.Tool.Output.Range{
  count: non_neg_integer(),
  kind: kind(),
  start: non_neg_integer(),
  total: total(),
  unit: unit()
}

total()

@type total() :: non_neg_integer() | :unknown

unit()

@type unit() :: :bytes | :lines | :items

Functions

new(kind, unit, start, count, total)

@spec new(kind(), unit(), non_neg_integer(), non_neg_integer(), total()) ::
  {:ok, t()} | {:error, :invalid_range}

Builds valid bounds. A known total must contain the selected interval.