Skip to content

QueryParams

[Source]

Parsed query parameters with key-based lookup.

Stores decoded key-value pairs in their original order. Duplicate keys are preserved — use get() for the first value or get_all() for every value associated with a key. Lookups are linear scans, which is appropriate for the small parameter counts typical of query strings.

class val QueryParams

Constructors

create

[Source]

Create from an array of decoded key-value pairs.

new val create(
  p: Array[(String val , String val)] val)
: QueryParams val^

Parameters

Returns


Public Functions

apply

[Source]

The pair at index i. Raises an error if out of bounds.

fun box apply(
  i: USize val)
: (String val , String val) ?

Parameters

Returns


get

[Source]

First value for key, or None if the key is absent.

When duplicate keys are possible and all values are needed, use get_all() instead.

fun box get(
  key: String val)
: (String val | None val)

Parameters

Returns


get_all

[Source]

All values for key, in order. Empty array if absent.

fun box get_all(
  key: String val)
: Array[String val] val

Parameters

Returns


contains

[Source]

Whether key is present.

fun box contains(
  key: String val)
: Bool val

Parameters

Returns


pairs

[Source]

All pairs in their original order.

fun box pairs()
: ArrayValues[(String val , String val), Array[(String val , String val)] val] ref^

Returns


size

[Source]

Number of pairs, including duplicates.

fun box size()
: USize val

Returns