Quartz v5.25

collections/queue

Structs

Queue (std/collections/queue.qz:15)

FieldType
_dataVec<Int>
_headInt

Methods

enqueue(): Void

Add a value to the back of the queue.

dequeue(): Option<Int>

Remove and return the front value. Returns Option::None if empty.

peek(): Option<Int>

Peek at the front value without removing it. Returns Option::None if empty.

size(): Int

Return the number of elements in the queue.

is_empty(): Bool

Return true if the queue is empty.

clear(): Void

Remove all elements from the queue.

free(): Void

Free the underlying storage.

push(): Void

Alias for enqueue — add to end.

shift(): Option<Int>

Alias for dequeue — remove from front.

first(): Option<Int>

Alias for peek — peek at front.

to_vec(): Vec<Int>
each(): Void
map(): Vec<Int>
filter(): Vec<Int>
reduce(): Int
find(): Int
any(): Bool
all(): Bool
count(): Int
iter(): QueueIter

Return an iterator over queue elements (front to back).

QueueIter (std/collections/queue.qz:208)

QueueIter — iterates over Queue elements from front to back.

FieldType
_dataVec<Int>
_indexInt
_endInt

Trait Implementations

impl Iterator for QueueIter

next(): Option<Int>

Functions

queue_new(): Queue (std/collections/queue.qz:21)

Create a new empty queue.