lobby-queue

Crates.iolobby-queue
lib.rslobby-queue
version0.2.0
sourcesrc
created_at2021-06-29 00:27:16.836496
updated_at2021-06-29 15:29:51.652673
descriptionConst-size queue-like data structure.
homepagehttps://github.com/Dophin2009/lobby
repositoryhttps://github.com/Dophin2009/lobby.git
max_upload_size
id415983
size25,656
Eric Zhao (mirryi)

documentation

README

Build
status Crates.io Docs.rs

lobby-queue

A const-size queue-like data structure.

Usage

Add lobby-queue to your Cargo.toml:

[dependencies]
lobby-queue = "0.2"

And use it:

use lobby_queue::Lobby;

fn main() {
    let mut m = Lobby::new([None, None, None]);

    m.push(0);
    m.push(1);
    m.push(2);
    assert_eq!(Some(&0), m.first());

    let v0 = m.push(3);
    assert_eq!(Some(0), v0);
    assert_eq!(Some(&1), m.first());

    for v in m {
        println!("{}", v);
    }
}
Commit count: 45

cargo fmt