Skip to content

stdlib/queueView source ↗

queue

2 items · generated by scribe fromstdlib/queue.fd· synced 2026-11-15

stdlib/queue2 items

Contents

Queue

A FIFO queue backed by Vec with a head index.

Example: var q = Queue::new(); q.enqueue(1); q.enqueue(2); q.enqueue(3); assert_eq(q.dequeue(), 1); assert_eq(q.peek(), 2); assert_eq(q.len(), 2); assert(q.contains(3)); q.clear(); assert(q.is_empty());

pub struct Queue<T> {

Fields:

NameType
dataVec<i64>, pub head: i64

Defined at line 29


Queue

impl Queue {

Defined at line 33


Generated by scribe, the Fides documentation generator