| Crates.io | icentral-node-queue |
| lib.rs | icentral-node-queue |
| version | 0.1.0 |
| created_at | 2025-04-04 21:00:04.137875+00 |
| updated_at | 2025-04-04 21:00:04.137875+00 |
| description | Efficient and dependable queue management for node identifiers, ideal for graph operations such as BFS. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1620746 |
| size | 52,113 |
icentral-node-queue is a Rust crate designed to manage a queue of node identifiers (NodeId) efficiently and reliably. This crate offers a robust NodeIdQueue struct along with a macro delegate_to_bfs_queue to facilitate the implementation of the Breadth-First Search (BFS) algorithm.
NodeIdQueue acts as a named queue, allowing you to store and manage node identifiers, imperative for graph traversal and related operations.
enqueue, dequeue, and peek.To utilize the icentral-node-queue, you must include it in your Cargo.toml dependencies:
[dependencies]
icentral-node-queue = "0.1.0"
use icentral_node_queue::{NodeIdQueue, delegate_to_bfs_queue};
fn main() {
let first_node = NodeId::new(1);
let mut queue = NodeIdQueue::new(first_node, "example_queue");
// Enqueue a node
queue.enqueue(NodeId::new(2));
// Peek at the first node in the queue
if let Some(node) = queue.peek() {
println!("Next node in queue: {:?}", node);
}
// Dequeue a node
if let Some(dequeued_node) = queue.dequeue() {
println!("Dequeued node: {:?}", dequeued_node);
}
}
This project is licensed under the MIT License. See the LICENSE file for details.
Note: This README.md file was generated by an AI model and may not be 100% accurate; however, it should be pretty good.
This crate is in the process of being translated from c++ to rust. Currently, it still needs exhaustive testing. It is likely there currently exist many glitches which need to be fixed before proper usage. This crate is based on the original icentral program developed by Fuad Jamor. Please see the following repository for details: https://github.com/fjamour/icentral.
For progress updates, see the workspacer rust project.