---
title: "items"
url: https://una-lang.org/en/docs/std/builtin/items/
release: v0.4.0
edition: "0.5 preview"
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/builtins.json
---

# items

A built-in method, resolved by the type of its receiver ([`spec/14 §2`](https://una-lang.org/en/docs/spec/14-standard-library/#s2)). Edition 0.5 preview.

```una
s.items() -> List[T]
  where s: Stack[T]
q.items() -> List[T]
  where q: Queue[T]
s.items() -> List[T]
  where s: Set[T]
s.items() -> List[T]
  where s: HashSet[T]
q.items() -> List[T]
  where q: PriorityQueue[T, P]
b.items() -> List[Int]
  where b: BitSet
```

The items as a list: a `Stack` top first and a `Queue` front first, as many as its `len`, in O(n) time (`spec/28 §5`); a `Set`'s in ascending order, as many as its `len`, in O(n) time (`spec/28 §6`); a `HashSet`'s in the order its items were first added, in O(n) time (`spec/28 §7`); a `PriorityQueue`'s in the order of the pops, in O(n log n) comparisons (`spec/28 §8`); a `BitSet`'s members in ascending order, in O(size / 64 + len) time (`spec/28 §9`).

## Specification

- `spec/28 §5`
- `spec/28 §6`
- `spec/28 §7`
- `spec/28 §8`
- `spec/28 §9`

Generated from una v0.4.0 ([`docs/std/builtins.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/builtins.json), which is not part of the specification): built-in methods have no declaration, so una writes these signature lines and tests each against its checker. The specification governs: [`spec/14 §2`](https://una-lang.org/en/docs/spec/14-standard-library/#s2).
