List[T]

typeList[T]

A growable array

functioncapacity(self: List[T]) u64

Returns the capacity of the current allocation of this list.

functionconcat(self: List[T], other: List[T]) List[T]

Concatenate this list with another, returning the result.

The arguments are not mutated by this function.

functionget(self: List[T], idx: u64) Option[T]

Get an element from the list.

This function returns None if the index is out of bounds.

functionis_empty(self: List[T]) bool

Returns whether is list is empty.

functionlen(self: List[T]) u64

Returns the length of this list.

functionnew() List[T]

Create a new empty list.

functionpush(self: List[T], elem: T)

Push an element to the end of this list.

functionswap(self: List[T], i: u64, j: u64)

Swap two elements in this list at the given indices.

This function does nothing if either i or j is out of bounds.