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

# peek_priority

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
q.peek_priority() -> Option[P]
  where q: PriorityQueue[T, P]
```

The priority of the item that `pop` would give from a `PriorityQueue`, as `Some`, and `None` exactly when it is empty, in O(1) time (`spec/28 §8`).

## Specification

- `spec/28 §8`

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).
