ExBoxPacker.LimitedSupplyBox protocol (ExBoxPacker v0.2.0)

Copy Markdown View Source

Optional protocol for boxes with a finite supply. A box implementing this is only used up to quantity_available/1 times. Boxes that do not implement it are treated as unlimited. Port of BoxPacker's LimitedSupplyBox.

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

quantity_available(box)

@spec quantity_available(t()) :: non_neg_integer()