dummy-queue

Crates.iodummy-queue
lib.rsdummy-queue
version1.1.0
sourcesrc
created_at2023-09-30 00:01:54.993584
updated_at2023-09-30 00:32:15.38173
descriptionA dummy implementation of queue in rust
homepage
repository
max_upload_size
id988230
size3,874
Sergio (nhulox97)

documentation

README

dummy-queue

Custom (and basic) implementation of queue using Box.

Usage

Queue supports T type means generic, so you are in charge to impl (if needed) any trait in case your use cases requires it. Any instance of T needs to be mut, otherwise Rust won't compile your code.

fn main() {
    let mut queue = Queue::<i32>::new();

    queue.enqueue(1);
    queue.enqueue(2);
    queue.enqueue(4);
    queue.enqueue(5);

    println!("Front of the queue: {:?}", queue.front());

    while !queue.is_empty() {
        println!("Dequeued: {:?}", queue.dequeue());
    }
}
Commit count: 0

cargo fmt