https://github.com/mirryi/lobby-queue
Const-size queue.
https://github.com/mirryi/lobby-queue
queue rust
Last synced: 9 months ago
JSON representation
Const-size queue.
- Host: GitHub
- URL: https://github.com/mirryi/lobby-queue
- Owner: mirryi
- License: mit
- Created: 2021-06-28T00:44:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-26T02:45:55.000Z (over 3 years ago)
- Last Synced: 2025-03-28T01:39:11.211Z (9 months ago)
- Topics: queue, rust
- Language: Rust
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/mirryi/lobby/actions)
[](https://crates.io/crates/lobby-queue)
[](https://docs.rs/lobby-queue)
# lobby-queue
A const-size queue-like data structure.
## Usage
Add lobby-queue to your `Cargo.toml`:
``` toml
[dependencies]
lobby-queue = "0.2"
```
And use it:
``` rust
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);
}
}
```